Class: Kentaa::Api::Resources::Question

Inherits:
Object
  • Object
show all
Defined in:
lib/kentaa/api/resources/question.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (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

#answerObject



29
30
31
# File 'lib/kentaa/api/resources/question.rb', line 29

def answer
  data[:answer]
end

#created_atObject



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

#idObject



13
14
15
# File 'lib/kentaa/api/resources/question.rb', line 13

def id
  data[:id]
end

#questionObject



25
26
27
# File 'lib/kentaa/api/resources/question.rb', line 25

def question
  data[:question]
end

#updated_atObject



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