Class: Kentaa::Api::Resources::Question
- Inherits:
-
Object
- Object
- Kentaa::Api::Resources::Question
- Defined in:
- lib/kentaa/api/resources/question.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #answer ⇒ Object
- #created_at ⇒ Object
- #id ⇒ Object
-
#initialize(data) ⇒ Question
constructor
A new instance of Question.
- #question ⇒ Object
- #updated_at ⇒ Object
Constructor Details
#initialize(data) ⇒ Question
Returns a new instance of Question.
9 10 11 |
# File 'lib/kentaa/api/resources/question.rb', line 9 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/kentaa/api/resources/question.rb', line 7 def data @data end |
Instance Method Details
#answer ⇒ Object
29 30 31 |
# File 'lib/kentaa/api/resources/question.rb', line 29 def answer data[:answer] end |
#created_at ⇒ Object
17 18 19 |
# File 'lib/kentaa/api/resources/question.rb', line 17 def created_at Time.parse(data[:created_at]) if data[:created_at] end |
#id ⇒ Object
13 14 15 |
# File 'lib/kentaa/api/resources/question.rb', line 13 def id data[:id] end |
#question ⇒ Object
25 26 27 |
# File 'lib/kentaa/api/resources/question.rb', line 25 def question data[:question] end |
#updated_at ⇒ Object
21 22 23 |
# File 'lib/kentaa/api/resources/question.rb', line 21 def updated_at Time.parse(data[:updated_at]) if data[:updated_at] end |