Class: Rdmm::Client
- Inherits:
-
Object
- Object
- Rdmm::Client
- Defined in:
- lib/rdmm/client.rb
Constant Summary collapse
- BASE_URL =
"https://api.dmm.com"
- PATH_TO_LIST_ACTRESSES =
"/affiliate/v3/ActressSearch"
- PATH_TO_LIST_AUTHORS =
"/affiliate/v3/AuthorSearch"
- PATH_TO_LIST_FLOORS =
"/affiliate/v3/FloorList"
- PATH_TO_LIST_GENRES =
"/affiliate/v3/GenreSearch"
- PATH_TO_LIST_ITEMS =
"/affiliate/v3/ItemList"
- PATH_TO_LIST_MAKERS =
"/affiliate/v3/MakerSearch"
- PATH_TO_LIST_SERIES =
"/affiliate/v3/SeriesSearch"
Instance Method Summary collapse
- #connection ⇒ Faraday::Connection
-
#initialize(affiliate_id:, api_id:) ⇒ Client
constructor
A new instance of Client.
- #list_actresses(options = {}) ⇒ Rdmm::Responses::ListActressesResponse
- #list_authors(options = {}) ⇒ Rdmm::Responses::ListAuthorsResponse
- #list_floors(options = {}) ⇒ Rdmm::Responses::ListFloorsResponse
- #list_genres(options = {}) ⇒ Rdmm::Responses::ListGenresResponse
- #list_items(options = {}) ⇒ Rdmm::Responses::ListItemsResponse
- #list_makers(options = {}) ⇒ Rdmm::Responses::ListMakersResponse
- #list_series(options = {}) ⇒ Rdmm::Responses::ListSeriesResponse
Constructor Details
#initialize(affiliate_id:, api_id:) ⇒ Client
Returns a new instance of Client.
17 18 19 20 |
# File 'lib/rdmm/client.rb', line 17 def initialize(affiliate_id:, api_id:) @affiliate_id = affiliate_id @api_id = api_id end |
Instance Method Details
#connection ⇒ Faraday::Connection
23 24 25 26 27 28 |
# File 'lib/rdmm/client.rb', line 23 def connection @connection ||= ::Faraday::Connection.new(url: BASE_URL) do |connection| connection.adapter :net_http connection.response :json end end |
#list_actresses(options = {}) ⇒ Rdmm::Responses::ListActressesResponse
32 33 34 35 36 37 38 39 |
# File 'lib/rdmm/client.rb', line 32 def list_actresses( = {}) list( query_class: ::Rdmm::Queries::ListActressesQuery, options: , path: PATH_TO_LIST_ACTRESSES, response_class: ::Rdmm::Responses::ListActressesResponse, ) end |
#list_authors(options = {}) ⇒ Rdmm::Responses::ListAuthorsResponse
43 44 45 46 47 48 49 50 |
# File 'lib/rdmm/client.rb', line 43 def ( = {}) list( query_class: ::Rdmm::Queries::ListAuthorsQuery, options: , path: PATH_TO_LIST_AUTHORS, response_class: ::Rdmm::Responses::ListAuthorsResponse, ) end |
#list_floors(options = {}) ⇒ Rdmm::Responses::ListFloorsResponse
54 55 56 57 58 59 60 61 |
# File 'lib/rdmm/client.rb', line 54 def list_floors( = {}) list( query_class: ::Rdmm::Queries::ListFloorsQuery, options: , path: PATH_TO_LIST_FLOORS, response_class: ::Rdmm::Responses::ListFloorsResponse, ) end |
#list_genres(options = {}) ⇒ Rdmm::Responses::ListGenresResponse
65 66 67 68 69 70 71 72 |
# File 'lib/rdmm/client.rb', line 65 def list_genres( = {}) list( query_class: ::Rdmm::Queries::ListGenresQuery, options: , path: PATH_TO_LIST_GENRES, response_class: ::Rdmm::Responses::ListGenresResponse, ) end |
#list_items(options = {}) ⇒ Rdmm::Responses::ListItemsResponse
76 77 78 79 80 81 82 83 |
# File 'lib/rdmm/client.rb', line 76 def list_items( = {}) list( query_class: ::Rdmm::Queries::ListItemsQuery, options: , path: PATH_TO_LIST_ITEMS, response_class: ::Rdmm::Responses::ListItemsResponse, ) end |
#list_makers(options = {}) ⇒ Rdmm::Responses::ListMakersResponse
87 88 89 90 91 92 93 94 |
# File 'lib/rdmm/client.rb', line 87 def list_makers( = {}) list( query_class: ::Rdmm::Queries::ListMakersQuery, options: , path: PATH_TO_LIST_MAKERS, response_class: ::Rdmm::Responses::ListMakersResponse, ) end |
#list_series(options = {}) ⇒ Rdmm::Responses::ListSeriesResponse
98 99 100 101 102 103 104 105 |
# File 'lib/rdmm/client.rb', line 98 def list_series( = {}) list( query_class: ::Rdmm::Queries::ListSeriesQuery, options: , path: PATH_TO_LIST_SERIES, response_class: ::Rdmm::Responses::ListSeriesResponse, ) end |