Class: TwicasStream::TwicasApiObject::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/twicas_stream/twicas_api_object/comment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elements = {}) ⇒ Comment

Returns a new instance of Comment.



11
12
13
14
15
16
17
18
19
20
# File 'lib/twicas_stream/twicas_api_object/comment.rb', line 11

def initialize elements = {}
	from_user = User.new(elements['from_user'])

	@object = {
				:id        => elements['id'],
				:message   => elements['message'],
				:from_user => from_user.object, 
				:created   => elements['created']
			}
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



9
10
11
# File 'lib/twicas_stream/twicas_api_object/comment.rb', line 9

def object
  @object
end