Class: Mangadex::Api::Response
- Inherits:
-
MangadexObject
- Object
- MangadexObject
- Mangadex::Api::Response
- Extended by:
- T::Generic, T::Sig
- Defined in:
- lib/mangadex/api/response.rb
Defined Under Namespace
Classes: Collection, Error
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#response ⇒ Object
Returns the value of attribute response.
-
#result ⇒ Object
Returns the value of attribute result.
-
#total ⇒ Object
Returns the value of attribute total.
Attributes included from Internal::WithAttributes
#attributes, #id, #relationships, #type
Class Method Summary collapse
Methods inherited from MangadexObject
#eq?, #hash, #initialize, #inspect
Constructor Details
This class inherits a constructor from Mangadex::MangadexObject
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/mangadex/api/response.rb', line 8 def data @data end |
#errors ⇒ Object
Returns the value of attribute errors.
8 9 10 |
# File 'lib/mangadex/api/response.rb', line 8 def errors @errors end |
#limit ⇒ Object
Returns the value of attribute limit.
9 10 11 |
# File 'lib/mangadex/api/response.rb', line 9 def limit @limit end |
#offset ⇒ Object
Returns the value of attribute offset.
9 10 11 |
# File 'lib/mangadex/api/response.rb', line 9 def offset @offset end |
#response ⇒ Object
Returns the value of attribute response.
8 9 10 |
# File 'lib/mangadex/api/response.rb', line 8 def response @response end |
#result ⇒ Object
Returns the value of attribute result.
8 9 10 |
# File 'lib/mangadex/api/response.rb', line 8 def result @result end |
#total ⇒ Object
Returns the value of attribute total.
9 10 11 |
# File 'lib/mangadex/api/response.rb', line 9 def total @total end |
Class Method Details
.attributes_to_inspect ⇒ Object
11 12 13 |
# File 'lib/mangadex/api/response.rb', line 11 def self.attributes_to_inspect i(result errors limit offset total data) end |
.coerce(data) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/mangadex/api/response.rb', line 31 def self.coerce(data) if data['errors'] coerce_errors(data) elsif data['response'] == 'entity' coerce_entity(data) elsif data['response'] == 'collection' coerce_collection(data) else data end end |