Class: Wanikani::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/wanikani/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_data) ⇒ Response

Returns a new instance of Response.



6
7
8
# File 'lib/wanikani/response.rb', line 6

def initialize(response_data)
  @response_data = response_data
end

Instance Attribute Details

#response_dataObject (readonly)

Returns the value of attribute response_data.



4
5
6
# File 'lib/wanikani/response.rb', line 4

def response_data
  @response_data
end

Instance Method Details

#dataObject



10
11
12
# File 'lib/wanikani/response.rb', line 10

def data
  response_data['data']
end

#data_updated_atObject



22
23
24
# File 'lib/wanikani/response.rb', line 22

def data_updated_at
  response_data['data_updated_at']
end

#idObject



14
15
16
# File 'lib/wanikani/response.rb', line 14

def id
  response_data['id']
end

#objectObject



18
19
20
# File 'lib/wanikani/response.rb', line 18

def object
  response_data['object']
end

#per_pageObject



26
27
28
# File 'lib/wanikani/response.rb', line 26

def per_page
  response_data['pages']['per_page']
end

#total_countObject



30
31
32
# File 'lib/wanikani/response.rb', line 30

def total_count
  response_data['total_count']
end