Class: RoQua::Answer
- Inherits:
-
Object
show all
- Defined in:
- lib/roqua/answer.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(attributes) ⇒ Answer
Returns a new instance of Answer.
5
6
7
|
# File 'lib/roqua/answer.rb', line 5
def initialize(attributes)
@attributes = attributes
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
29
30
31
|
# File 'lib/roqua/answer.rb', line 29
def method_missing(name, *args)
@attributes.fetch(name.to_s)
end
|
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3
4
5
|
# File 'lib/roqua/answer.rb', line 3
def attributes
@attributes
end
|
Instance Method Details
#completed? ⇒ Boolean
13
14
15
|
# File 'lib/roqua/answer.rb', line 13
def completed?
@attributes["is_completed"]
end
|
#completed_at ⇒ Object
25
26
27
|
# File 'lib/roqua/answer.rb', line 25
def completed_at
Time.parse(attributes["completed_at"])
end
|
#created_at ⇒ Object
17
18
19
|
# File 'lib/roqua/answer.rb', line 17
def created_at
Time.parse(attributes["created_at"])
end
|
#id ⇒ Object
9
10
11
|
# File 'lib/roqua/answer.rb', line 9
def id
@attributes["_id"]
end
|
#updated_at ⇒ Object
21
22
23
|
# File 'lib/roqua/answer.rb', line 21
def updated_at
Time.parse(attributes["updated_at"])
end
|