Class: Ayadn::EntitiesObject

Inherits:
Object
  • Object
show all
Defined in:
lib/ayadn/post_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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) }
  hashtags = @input["hashtags"].nil? ? [] : @input["hashtags"]
  @hashtags = hashtags.map { |hash| PostHashtagObject.new(hash) }
  links = @input["links"].nil? ? [] : @input["links"]
  @links = links.map { |hash| PostLinkObject.new(hash) }
end

Instance Attribute Details

#hashtagsObject (readonly)

Returns the value of attribute hashtags.



60
61
62
# File 'lib/ayadn/post_object.rb', line 60

def hashtags
  @hashtags
end

#inputObject (readonly)

Returns the value of attribute input.



60
61
62
# File 'lib/ayadn/post_object.rb', line 60

def input
  @input
end

Returns the value of attribute links.



60
61
62
# File 'lib/ayadn/post_object.rb', line 60

def links
  @links
end

#mentionsObject (readonly)

Returns the value of attribute mentions.



60
61
62
# File 'lib/ayadn/post_object.rb', line 60

def mentions
  @mentions
end