Class: Ayadn::EntitiesObject
Instance Attribute Summary collapse
-
#hashtags ⇒ Object
readonly
Returns the value of attribute hashtags.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#links ⇒ Object
readonly
Returns the value of attribute links.
-
#mentions ⇒ Object
readonly
Returns the value of attribute mentions.
Instance Method Summary collapse
-
#initialize(hash) ⇒ EntitiesObject
constructor
A new instance of EntitiesObject.
Constructor Details
#initialize(hash) ⇒ EntitiesObject
Returns a new instance of EntitiesObject.
62 63 64 65 66 67 68 69 70 |
# File 'lib/ayadn/post_object.rb', line 62 def initialize hash @input = hash["entities"].nil? ? {} : hash["entities"] mentions = @input["mentions"].nil? ? [] : @input["mentions"] @mentions = mentions.map { |hash| PostMentionObject.new(hash) } = @input["hashtags"].nil? ? [] : @input["hashtags"] @hashtags = .map { |hash| PostHashtagObject.new(hash) } links = @input["links"].nil? ? [] : @input["links"] @links = links.map { |hash| PostLinkObject.new(hash) } end |
Instance Attribute Details
#hashtags ⇒ Object (readonly)
Returns the value of attribute hashtags.
60 61 62 |
# File 'lib/ayadn/post_object.rb', line 60 def @hashtags end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
60 61 62 |
# File 'lib/ayadn/post_object.rb', line 60 def input @input end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
60 61 62 |
# File 'lib/ayadn/post_object.rb', line 60 def links @links end |
#mentions ⇒ Object (readonly)
Returns the value of attribute mentions.
60 61 62 |
# File 'lib/ayadn/post_object.rb', line 60 def mentions @mentions end |