Class: Wanikani::Response
- Inherits:
-
Object
- Object
- Wanikani::Response
- Defined in:
- lib/wanikani/response.rb
Instance Attribute Summary collapse
-
#response_data ⇒ Object
readonly
Returns the value of attribute response_data.
Instance Method Summary collapse
- #data ⇒ Object
- #data_updated_at ⇒ Object
- #id ⇒ Object
-
#initialize(response_data) ⇒ Response
constructor
A new instance of Response.
- #object ⇒ Object
- #per_page ⇒ Object
- #total_count ⇒ Object
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_data ⇒ Object (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
#data ⇒ Object
10 11 12 |
# File 'lib/wanikani/response.rb', line 10 def data response_data['data'] end |
#data_updated_at ⇒ Object
22 23 24 |
# File 'lib/wanikani/response.rb', line 22 def data_updated_at response_data['data_updated_at'] end |
#id ⇒ Object
14 15 16 |
# File 'lib/wanikani/response.rb', line 14 def id response_data['id'] end |
#object ⇒ Object
18 19 20 |
# File 'lib/wanikani/response.rb', line 18 def object response_data['object'] end |
#per_page ⇒ Object
26 27 28 |
# File 'lib/wanikani/response.rb', line 26 def per_page response_data['pages']['per_page'] end |
#total_count ⇒ Object
30 31 32 |
# File 'lib/wanikani/response.rb', line 30 def total_count response_data['total_count'] end |