Class: PostProxy::PlatformParams
Instance Attribute Summary collapse
-
#facebook ⇒ Object
Returns the value of attribute facebook.
-
#instagram ⇒ Object
Returns the value of attribute instagram.
-
#linkedin ⇒ Object
Returns the value of attribute linkedin.
-
#pinterest ⇒ Object
Returns the value of attribute pinterest.
-
#threads ⇒ Object
Returns the value of attribute threads.
-
#tiktok ⇒ Object
Returns the value of attribute tiktok.
-
#twitter ⇒ Object
Returns the value of attribute twitter.
-
#youtube ⇒ Object
Returns the value of attribute youtube.
Instance Method Summary collapse
Methods inherited from Model
Constructor Details
This class inherits a constructor from PostProxy::Model
Instance Attribute Details
#facebook ⇒ Object
Returns the value of attribute facebook.
182 183 184 |
# File 'lib/postproxy/types.rb', line 182 def facebook @facebook end |
#instagram ⇒ Object
Returns the value of attribute instagram.
182 183 184 |
# File 'lib/postproxy/types.rb', line 182 def instagram @instagram end |
#linkedin ⇒ Object
Returns the value of attribute linkedin.
182 183 184 |
# File 'lib/postproxy/types.rb', line 182 def linkedin @linkedin end |
#pinterest ⇒ Object
Returns the value of attribute pinterest.
182 183 184 |
# File 'lib/postproxy/types.rb', line 182 def pinterest @pinterest end |
#threads ⇒ Object
Returns the value of attribute threads.
182 183 184 |
# File 'lib/postproxy/types.rb', line 182 def threads @threads end |
#tiktok ⇒ Object
Returns the value of attribute tiktok.
182 183 184 |
# File 'lib/postproxy/types.rb', line 182 def tiktok @tiktok end |
#twitter ⇒ Object
Returns the value of attribute twitter.
182 183 184 |
# File 'lib/postproxy/types.rb', line 182 def twitter @twitter end |
#youtube ⇒ Object
Returns the value of attribute youtube.
182 183 184 |
# File 'lib/postproxy/types.rb', line 182 def youtube @youtube end |
Instance Method Details
#to_h ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/postproxy/types.rb', line 185 def to_h result = {} %i[facebook instagram tiktok linkedin youtube pinterest threads twitter].each do |platform| value = send(platform) next if value.nil? params = value.is_a?(Model) ? value.to_h : value result[platform] = params.reject { |_, v| v.nil? } end result end |