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.
780 781 782 783 784 785 786 |
# File 'lib/postproxy/types.rb', line 780 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.
777 778 779 |
# File 'lib/postproxy/types.rb', line 777 def audio_name @audio_name end |
#collaborators ⇒ Object
Returns the value of attribute collaborators.
777 778 779 |
# File 'lib/postproxy/types.rb', line 777 def collaborators @collaborators end |
#cover_url ⇒ Object
Returns the value of attribute cover_url.
777 778 779 |
# File 'lib/postproxy/types.rb', line 777 def cover_url @cover_url end |
#first_comment ⇒ Object
Returns the value of attribute first_comment.
777 778 779 |
# File 'lib/postproxy/types.rb', line 777 def first_comment @first_comment end |
#format ⇒ Object
Returns the value of attribute format.
777 778 779 |
# File 'lib/postproxy/types.rb', line 777 def format @format end |
#thumb_offset ⇒ Object
Returns the value of attribute thumb_offset.
777 778 779 |
# File 'lib/postproxy/types.rb', line 777 def thumb_offset @thumb_offset end |
#trial_strategy ⇒ Object
Returns the value of attribute trial_strategy.
777 778 779 |
# File 'lib/postproxy/types.rb', line 777 def trial_strategy @trial_strategy end |
#user_tags ⇒ Object
Returns the value of attribute user_tags.
777 778 779 |
# File 'lib/postproxy/types.rb', line 777 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.
790 791 792 793 794 795 796 797 798 799 |
# File 'lib/postproxy/types.rb', line 790 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 |