Class: PostProxy::InstagramParams
Instance Attribute Summary collapse
-
#audio_name ⇒ Object
Returns the value of attribute audio_name.
-
#collaborators ⇒ Object
Returns the value of attribute collaborators.
-
#cover_url ⇒ Object
Returns the value of attribute cover_url.
-
#first_comment ⇒ Object
Returns the value of attribute first_comment.
-
#format ⇒ Object
Returns the value of attribute format.
-
#thumb_offset ⇒ Object
Returns the value of attribute thumb_offset.
-
#trial_strategy ⇒ Object
Returns the value of attribute trial_strategy.
-
#user_tags ⇒ Object
Returns the value of attribute user_tags.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ InstagramParams
constructor
A new instance of InstagramParams.
-
#to_h ⇒ Object
User tags must reach the wire as plain hashes, with unset coordinates dropped rather than sent as nulls.
Constructor Details
#initialize(**attrs) ⇒ InstagramParams
Returns a new instance of InstagramParams.
679 680 681 682 683 684 685 |
# File 'lib/postproxy/types.rb', line 679 def initialize(**attrs) @user_tags = nil super @user_tags = @user_tags&.map do |t| t.is_a?(InstagramUserTag) ? t : InstagramUserTag.new(**t.transform_keys(&:to_sym)) end end |
Instance Attribute Details
#audio_name ⇒ Object
Returns the value of attribute audio_name.
676 677 678 |
# File 'lib/postproxy/types.rb', line 676 def audio_name @audio_name end |
#collaborators ⇒ Object
Returns the value of attribute collaborators.
676 677 678 |
# File 'lib/postproxy/types.rb', line 676 def collaborators @collaborators end |
#cover_url ⇒ Object
Returns the value of attribute cover_url.
676 677 678 |
# File 'lib/postproxy/types.rb', line 676 def cover_url @cover_url end |
#first_comment ⇒ Object
Returns the value of attribute first_comment.
676 677 678 |
# File 'lib/postproxy/types.rb', line 676 def first_comment @first_comment end |
#format ⇒ Object
Returns the value of attribute format.
676 677 678 |
# File 'lib/postproxy/types.rb', line 676 def format @format end |
#thumb_offset ⇒ Object
Returns the value of attribute thumb_offset.
676 677 678 |
# File 'lib/postproxy/types.rb', line 676 def thumb_offset @thumb_offset end |
#trial_strategy ⇒ Object
Returns the value of attribute trial_strategy.
676 677 678 |
# File 'lib/postproxy/types.rb', line 676 def trial_strategy @trial_strategy end |
#user_tags ⇒ Object
Returns the value of attribute user_tags.
676 677 678 |
# File 'lib/postproxy/types.rb', line 676 def @user_tags end |
Instance Method Details
#to_h ⇒ Object
User tags must reach the wire as plain hashes, with unset coordinates dropped rather than sent as nulls.
689 690 691 692 693 694 695 696 697 698 |
# File 'lib/postproxy/types.rb', line 689 def to_h result = super = result[:user_tags] return result if .nil? result[:user_tags] = .map do |t| (t.is_a?(Model) ? t.to_h : t).reject { |_, v| v.nil? } end result end |