Class: Precious::API::V2::Characters
- Defined in:
- lib/precious/characters.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get_character(id:) ⇒ Object
GET the-one-api.dev/v2/character/id.
-
#get_character_quotes(id:, limit: 0, page: 0, offset: 0) ⇒ Object
GET the-one-api.dev/v2/character/id/quote.
- #get_characters(limit: 0, page: 0, offset: 0) ⇒ Object
Methods inherited from Base
Constructor Details
This class inherits a constructor from Precious::API::V2::Base
Instance Method Details
#get_character(id:) ⇒ Object
GET the-one-api.dev/v2/character/id
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/precious/characters.rb', line 19 def get_character(id:) params = { _id: id } request( http_method: :get, endpoint: "character", params: params ) end |
#get_character_quotes(id:, limit: 0, page: 0, offset: 0) ⇒ Object
GET the-one-api.dev/v2/character/id/quote
32 33 34 35 36 37 38 39 40 |
# File 'lib/precious/characters.rb', line 32 def get_character_quotes(id:, limit: 0, page: 0, offset: 0) params = set_params(limit: limit, page: page, offset: offset) request( http_method: :get, endpoint: "character/#{id}/quote", params: params ) end |
#get_characters(limit: 0, page: 0, offset: 0) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/precious/characters.rb', line 8 def get_characters(limit: 0, page: 0, offset: 0) params = set_params(limit: limit, page: page, offset: offset) request( http_method: :get, endpoint: "character", params: params ) end |