rdmm 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 797feaa50ea35e16f8af971efd781df57873dec2
4
- data.tar.gz: 62bd6f5681c228749eb6360ab6b535b1b3d4960f
3
+ metadata.gz: fe940e5aad4abe9b0e14b6079c65e56cd6dd1aa5
4
+ data.tar.gz: eafea0273111151c1e2d81db7dc75961afe931cb
5
5
  SHA512:
6
- metadata.gz: c5129b49068efee763021055e52cd44b49b92090a99c2e9b899ca83ec90e1e1feb66e599d02d4af58ad50b8ae521842ffdd9015ae6e669b52fb2a1d9e6aab1de
7
- data.tar.gz: bce7ec73cb17b65a0f493e4e78b1426caa5ddd47fd2260e2ccdf2e986fca79f17fd53a35fe3fe6d1a63300a9799f65631d982fd9179094149693be76cc9b60ad
6
+ metadata.gz: 34aa24a950848b870d755ee50411482c2839e31aa9a10e61ea90ce5d7f86c9a0333434d1f06be7b2174e1c0e96246efb15edb346e0650ea142373374905a5e2c
7
+ data.tar.gz: 22d6e35a24d8d9f7c6c14735ceb5dc472526c861d1c94a0dbef22c7df98c5f73081aacadd91bf7133486267dfb4385c5d29f8f2feb844300f7d35e407e5a81a4
@@ -1,3 +1,16 @@
1
+ ## 0.1.0
2
+
3
+ - Add `Rdmm::Client#list_actresses`
4
+ - Add `Rdmm::Client#list_authors`
5
+ - Add `Rdmm::Client#list_floors`
6
+ - Add `Rdmm::Client#list_genres`
7
+ - Add `Rdmm::Client#list_makers`
8
+ - Rename `#series_id` to `#id` on `Rdmm::Resources::SeriesResource`
9
+
10
+ ## 0.0.4
11
+
12
+ - Declare required ruby version on gemspec
13
+
1
14
  ## 0.0.3
2
15
 
3
16
  - Add `Rdmm::Responses::BaseResponse#first_position`
data/README.md CHANGED
@@ -4,7 +4,9 @@
4
4
  [![Gem Version](https://badge.fury.io/rb/rdmm.svg)](https://rubygems.org/gems/rdmm)
5
5
  [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/github/r7kamura/rdmm)
6
6
 
7
- An API Client library for DMM written in Ruby.
7
+ An API Client library for DMM Web Service written in Ruby.
8
+
9
+ See https://affiliate.dmm.com/api/ for more details about DMM Web Service.
8
10
 
9
11
  ## Requirements
10
12
 
@@ -39,6 +41,66 @@ require "rdmm"
39
41
  client = Rdmm::Client.new(affiliate_id: "dummy", api_id: "dummy")
40
42
  ```
41
43
 
44
+ ### Rdmm::Client#list_actresses
45
+
46
+ Available options:
47
+
48
+ - `:id`
49
+ - `:birthday`
50
+ - `:bust`
51
+ - `:height`
52
+ - `:hip`
53
+ - `:hits`
54
+ - `:initial`
55
+ - `:keyword`
56
+ - `:offset`
57
+ - `:sort`
58
+ - `:waist`
59
+
60
+ ```ruby
61
+ client.list_actresses
62
+ ```
63
+
64
+ `https://api.dmm.com/affiliate/v3/ActressSearch?affiliate_id=dummy&api_id=dummy`
65
+
66
+ ### Rdmm::Client#list_authors
67
+
68
+ Available options:
69
+
70
+ - `:floor_id`
71
+ - `:hits`
72
+ - `:initial`
73
+ - `:offset`
74
+
75
+ ```ruby
76
+ client.list_authors(floor_id: 27)
77
+ ```
78
+
79
+ `https://api.dmm.com/affiliate/v3/AuthorSearch?affiliate_id=dummy&api_id=dummy&floor_id=27`
80
+
81
+ ### Rdmm::Client#list_floors
82
+
83
+ ```ruby
84
+ client.list_floors
85
+ ```
86
+
87
+ `https://api.dmm.com/affiliate/v3/FloorList?affiliate_id=dummy&api_id=dummy`
88
+
89
+ ### Rdmm::Client#list_genres
90
+
91
+ Available options:
92
+
93
+ - `:floor_id`
94
+ - `:hits`
95
+ - `:initial`
96
+ - `:offset`
97
+
98
+ ```ruby
99
+ client.list_genres(floor_id: 27)
100
+ ```
101
+
102
+ `https://api.dmm.com/affiliate/v3/GenreSearch?affiliate_id=dummy&api_id=dummy&floor_id=27`
103
+
42
104
  ### Rdmm::Client#list_items
43
105
 
44
106
  Available options:
@@ -63,6 +125,21 @@ client.list_items(site: "DMM.com")
63
125
 
64
126
  `https://api.dmm.com/affiliate/v3/ItemList?affiliate_id=dummy&api_id=dummy&site=DMM.com`
65
127
 
128
+ ### Rdmm::Client#list_makers
129
+
130
+ Available options:
131
+
132
+ - `:floor_id`
133
+ - `:hits`
134
+ - `:initial`
135
+ - `:offset`
136
+
137
+ ```ruby
138
+ client.list_makers(floor_id: 27)
139
+ ```
140
+
141
+ `https://api.dmm.com/affiliate/v3/MakerSearch?affiliate_id=dummy&api_id=dummy&floor_id=27`
142
+
66
143
  ### Rdmm::Client#list_series
67
144
 
68
145
  Available options:
@@ -114,6 +191,51 @@ client.list_items(site: "DMM.com").map(&:title)
114
191
 
115
192
  </details>
116
193
 
194
+ ### Rdmm::Responses::BaseResponse#first_position
195
+
196
+ ```ruby
197
+ client.list_items(site: "DMM.com").first_position
198
+ ```
199
+
200
+ <details>
201
+ <summary>output</summary>
202
+
203
+ ```ruby
204
+ 1
205
+ ```
206
+
207
+ </details>
208
+
209
+ ### Rdmm::Responses::BaseResponse#has_next_page?
210
+
211
+ ```ruby
212
+ client.list_items(site: "DMM.com").has_next_page?
213
+ ```
214
+
215
+ <details>
216
+ <summary>output</summary>
217
+
218
+ ```ruby
219
+ true
220
+ ```
221
+
222
+ </details>
223
+
224
+ ### Rdmm::Responses::BaseResponse#result_count
225
+
226
+ ```ruby
227
+ client.list_items(site: "DMM.com").result_count
228
+ ```
229
+
230
+ <details>
231
+ <summary>output</summary>
232
+
233
+ ```ruby
234
+ 20
235
+ ```
236
+
237
+ </details>
238
+
117
239
  ### Rdmm::Responses::BaseResponse#total_count
118
240
 
119
241
  ```ruby
@@ -129,6 +251,60 @@ client.list_items(site: "DMM.com").total_count
129
251
 
130
252
  </details>
131
253
 
254
+ ### Rdmm::Resources::ActressResource
255
+
256
+ Available attributes:
257
+
258
+ - `birthday`
259
+ - `blood_type`
260
+ - `bust`
261
+ - `cup`
262
+ - `height`
263
+ - `hobbies`
264
+ - `id`
265
+ - `image_url_large`
266
+ - `image_url_small`
267
+ - `list_url_digital`
268
+ - `list_url_mono`
269
+ - `list_url_monthly`
270
+ - `list_url_ppm`
271
+ - `list_url_rental`
272
+ - `name`
273
+ - `prefectures`
274
+ - `ruby`
275
+ - `waist`
276
+
277
+ ### Rdmm::Resources::AuthorResource
278
+
279
+ Available attributes:
280
+
281
+ - `another_name`
282
+ - `id`
283
+ - `list_url`
284
+ - `name`
285
+ - `ruby`
286
+
287
+ ### Rdmm::Resources::FloorResource
288
+
289
+ Available attributes:
290
+
291
+ - `code`
292
+ - `id`
293
+ - `name`
294
+ - `service_code`
295
+ - `service_name`
296
+ - `site_code`
297
+ - `site_name`
298
+
299
+ ### Rdmm::Resources::GenreResource
300
+
301
+ Available attributes:
302
+
303
+ - `id`
304
+ - `list_url`
305
+ - `name`
306
+ - `ruby`
307
+
132
308
  ### Rdmm::Resources::ItemResource
133
309
 
134
310
  Available attributes:
@@ -157,37 +333,21 @@ Available attributes:
157
333
  - `url`
158
334
  - `volume`
159
335
 
160
- ```ruby
161
- client.list_items(site: "DMM.com").first.title
162
- ```
336
+ ### Rdmm::Resources::MakerResource
163
337
 
164
- <details>
165
- <summary>output</summary>
338
+ Available attributes:
166
339
 
167
- ```ruby
168
- "キングダム"
169
- ```
340
+ - `id`
341
+ - `list_url`
342
+ - `name`
343
+ - `ruby`
170
344
 
171
- </details>
172
345
 
173
346
  ### Rdmm::Resources::SeriesResource
174
347
 
175
348
  Available attributes:
176
349
 
350
+ - `id`
177
351
  - `list_url`
178
352
  - `name`
179
353
  - `ruby`
180
- - `series_id`
181
-
182
- ```ruby
183
- client.list_series(floor_id: 27).first.name
184
- ```
185
-
186
- <details>
187
- <summary>output</summary>
188
-
189
- ```ruby
190
- "二四〇九階の彼女"
191
- ```
192
-
193
- </details>
@@ -1,11 +1,26 @@
1
1
  require "rdmm/client"
2
2
  require "rdmm/queries/base_query"
3
+ require "rdmm/queries/list_actresses_query"
4
+ require "rdmm/queries/list_authors_query"
5
+ require "rdmm/queries/list_floors_query"
6
+ require "rdmm/queries/list_genres_query"
3
7
  require "rdmm/queries/list_items_query"
8
+ require "rdmm/queries/list_makers_query"
4
9
  require "rdmm/queries/list_series_query"
5
10
  require "rdmm/resources/base_resource"
11
+ require "rdmm/resources/actress_resource"
12
+ require "rdmm/resources/author_resource"
13
+ require "rdmm/resources/floor_resource"
14
+ require "rdmm/resources/genre_resource"
6
15
  require "rdmm/resources/item_resource"
16
+ require "rdmm/resources/maker_resource"
7
17
  require "rdmm/resources/series_resource"
8
18
  require "rdmm/responses/base_response"
19
+ require "rdmm/responses/list_actresses_response"
20
+ require "rdmm/responses/list_authors_response"
21
+ require "rdmm/responses/list_floors_response"
22
+ require "rdmm/responses/list_genres_response"
9
23
  require "rdmm/responses/list_items_response"
24
+ require "rdmm/responses/list_makers_response"
10
25
  require "rdmm/responses/list_series_response"
11
26
  require "rdmm/version"
@@ -4,7 +4,12 @@ require "faraday_middleware"
4
4
  module Rdmm
5
5
  class Client
6
6
  BASE_URL = "https://api.dmm.com"
7
+ PATH_TO_LIST_ACTRESSES = "/affiliate/v3/ActressSearch"
8
+ PATH_TO_LIST_AUTHORS = "/affiliate/v3/AuthorSearch"
9
+ PATH_TO_LIST_FLOORS = "/affiliate/v3/FloorList"
10
+ PATH_TO_LIST_GENRES = "/affiliate/v3/GenreSearch"
7
11
  PATH_TO_LIST_ITEMS = "/affiliate/v3/ItemList"
12
+ PATH_TO_LIST_MAKERS = "/affiliate/v3/MakerSearch"
8
13
  PATH_TO_LIST_SERIES = "/affiliate/v3/SeriesSearch"
9
14
 
10
15
  # @param affiliate_id [String]
@@ -23,22 +28,81 @@ module Rdmm
23
28
  end
24
29
  end
25
30
 
31
+ # @param options [Hash]
32
+ # @return [Rdmm::Responses::ListActressesResponse]
33
+ def list_actresses(options = {})
34
+ list(
35
+ query_class: ::Rdmm::Queries::ListActressesQuery,
36
+ options: options,
37
+ path: PATH_TO_LIST_ACTRESSES,
38
+ response_class: ::Rdmm::Responses::ListActressesResponse,
39
+ )
40
+ end
41
+
42
+ # @param options [Hash]
43
+ # @return [Rdmm::Responses::ListAuthorsResponse]
44
+ def list_authors(options = {})
45
+ list(
46
+ query_class: ::Rdmm::Queries::ListAuthorsQuery,
47
+ options: options,
48
+ path: PATH_TO_LIST_AUTHORS,
49
+ response_class: ::Rdmm::Responses::ListAuthorsResponse,
50
+ )
51
+ end
52
+
53
+ # @param options [Hash]
54
+ # @return [Rdmm::Responses::ListFloorsResponse]
55
+ def list_floors(options = {})
56
+ list(
57
+ query_class: ::Rdmm::Queries::ListFloorsQuery,
58
+ options: options,
59
+ path: PATH_TO_LIST_FLOORS,
60
+ response_class: ::Rdmm::Responses::ListFloorsResponse,
61
+ )
62
+ end
63
+
64
+ # @param options [Hash]
65
+ # @return [Rdmm::Responses::ListGenresResponse]
66
+ def list_genres(options = {})
67
+ list(
68
+ query_class: ::Rdmm::Queries::ListGenresQuery,
69
+ options: options,
70
+ path: PATH_TO_LIST_GENRES,
71
+ response_class: ::Rdmm::Responses::ListGenresResponse,
72
+ )
73
+ end
74
+
26
75
  # @param options [Hash]
27
76
  # @return [Rdmm::Responses::ListItemsResponse]
28
77
  def list_items(options = {})
29
- query_options = default_query_options.merge(options)
30
- query = ::Rdmm::Queries::ListItemsQuery.new(query_options)
31
- faraday_response = get(PATH_TO_LIST_ITEMS, query.to_hash)
32
- ::Rdmm::Responses::ListItemsResponse.new(faraday_response)
78
+ list(
79
+ query_class: ::Rdmm::Queries::ListItemsQuery,
80
+ options: options,
81
+ path: PATH_TO_LIST_ITEMS,
82
+ response_class: ::Rdmm::Responses::ListItemsResponse,
83
+ )
84
+ end
85
+
86
+ # @param options [Hash]
87
+ # @return [Rdmm::Responses::ListMakersResponse]
88
+ def list_makers(options = {})
89
+ list(
90
+ query_class: ::Rdmm::Queries::ListMakersQuery,
91
+ options: options,
92
+ path: PATH_TO_LIST_MAKERS,
93
+ response_class: ::Rdmm::Responses::ListMakersResponse,
94
+ )
33
95
  end
34
96
 
35
97
  # @param options [Hash]
36
98
  # @return [Rdmm::Responses::ListSeriesResponse]
37
99
  def list_series(options = {})
38
- query_options = default_query_options.merge(options)
39
- query = ::Rdmm::Queries::ListSeriesQuery.new(query_options)
40
- faraday_response = get(PATH_TO_LIST_SERIES, query.to_hash)
41
- ::Rdmm::Responses::ListSeriesResponse.new(faraday_response)
100
+ list(
101
+ query_class: ::Rdmm::Queries::ListSeriesQuery,
102
+ options: options,
103
+ path: PATH_TO_LIST_SERIES,
104
+ response_class: ::Rdmm::Responses::ListSeriesResponse,
105
+ )
42
106
  end
43
107
 
44
108
  private
@@ -51,12 +115,16 @@ module Rdmm
51
115
  }
52
116
  end
53
117
 
54
- # @private
118
+ # @param query_class [Class]
119
+ # @param options [Hash]
55
120
  # @param path [String]
56
- # @param query [Hash]
57
- # @return [Faraday::Response]
58
- def get(path, query)
59
- connection.get(path, query)
121
+ # @param response_class [Class]
122
+ # @return [Rdmm::Responses::BaseResponse]
123
+ def list(query_class:, options:, path:, response_class:)
124
+ query_options = default_query_options.merge(options)
125
+ query = query_class.new(query_options)
126
+ faraday_response = connection.get(path, query.to_hash)
127
+ response_class.new(faraday_response)
60
128
  end
61
129
  end
62
130
  end
@@ -22,8 +22,6 @@ module Rdmm
22
22
 
23
23
  property :affiliate_id
24
24
  property :api_id
25
- property :hits
26
- property :offset
27
25
 
28
26
  # @param options [Hash]
29
27
  def initialize(options = {})
@@ -40,16 +38,6 @@ module Rdmm
40
38
  options[:api_id]
41
39
  end
42
40
 
43
- # @return [Integer, nil]
44
- def hits
45
- options[:hits]
46
- end
47
-
48
- # @return [Integer, nil]
49
- def offset
50
- options[:offset]
51
- end
52
-
53
41
  # @return [Hash]
54
42
  def to_hash
55
43
  self.class.property_names.each_with_object({}) do |property_name, result|
@@ -0,0 +1,84 @@
1
+ module Rdmm
2
+ module Queries
3
+ class ListActressesQuery < BaseQuery
4
+ property :actress_id
5
+ property :birthday
6
+ property :bust
7
+ property :height
8
+ property :hip
9
+ property :hits
10
+ property :initial
11
+ property :keyword
12
+ property :offset
13
+ property :sort
14
+ property :waist
15
+
16
+ # @return [Integer, nil]
17
+ def actress_id
18
+ options[:id]
19
+ end
20
+
21
+ # @return [String, nil]
22
+ def birthday
23
+ format_from_and_to(options[:birthday_from], options[:birthday_to])
24
+ end
25
+
26
+ # @return [String, nil]
27
+ def bust
28
+ format_from_and_to(options[:bust_from], options[:bust_to])
29
+ end
30
+
31
+ # @return [String, nil]
32
+ def height
33
+ format_from_and_to(options[:height_from], options[:height_to])
34
+ end
35
+
36
+ # @return [String, nil]
37
+ def hip
38
+ format_from_and_to(options[:hip_from], options[:hip_from])
39
+ end
40
+
41
+ # @return [Integer, nil]
42
+ def hits
43
+ options[:hits]
44
+ end
45
+
46
+ # @return [String, nil]
47
+ def initial
48
+ options[:initial]
49
+ end
50
+
51
+ # @return [String, nil]
52
+ def keyword
53
+ options[:keyword]
54
+ end
55
+
56
+ # @return [Integer, nil]
57
+ def offset
58
+ options[:offset]
59
+ end
60
+
61
+ # @return [String, nil]
62
+ def sort
63
+ options[:sort]
64
+ end
65
+
66
+ # @return [String, nil]
67
+ def waist
68
+ format_from_and_to(options[:waist_from], options[:waist_from])
69
+ end
70
+
71
+ private
72
+
73
+ # @return [String, nil]
74
+ def format_from_and_to(from, to)
75
+ if from || to
76
+ [
77
+ from.respond_to?(:strftime) ? from.strftime("%Y%m%d") : from,
78
+ to.respond_to?(:strftime) ? to.strftime("%Y%m%d") : to,
79
+ ].join("-")
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,30 @@
1
+ module Rdmm
2
+ module Queries
3
+ class ListAuthorsQuery < BaseQuery
4
+ property :floor_id
5
+ property :hits
6
+ property :initial
7
+ property :offset
8
+
9
+ # @return [Integer, nil]
10
+ def floor_id
11
+ options[:floor_id]
12
+ end
13
+
14
+ # @return [Integer, nil]
15
+ def hits
16
+ options[:hits]
17
+ end
18
+
19
+ # @return [String, nil]
20
+ def initial
21
+ options[:initial]
22
+ end
23
+
24
+ # @return [Integer, nil]
25
+ def offset
26
+ options[:offset]
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,6 @@
1
+ module Rdmm
2
+ module Queries
3
+ class ListFloorsQuery < BaseQuery
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,30 @@
1
+ module Rdmm
2
+ module Queries
3
+ class ListGenresQuery < BaseQuery
4
+ property :floor_id
5
+ property :hits
6
+ property :initial
7
+ property :offset
8
+
9
+ # @return [Integer, nil]
10
+ def floor_id
11
+ options[:floor_id]
12
+ end
13
+
14
+ # @return [Integer, nil]
15
+ def hits
16
+ options[:hits]
17
+ end
18
+
19
+ # @return [String, nil]
20
+ def initial
21
+ options[:initial]
22
+ end
23
+
24
+ # @return [Integer, nil]
25
+ def offset
26
+ options[:offset]
27
+ end
28
+ end
29
+ end
30
+ end
@@ -6,9 +6,11 @@ module Rdmm
6
6
  property :cid
7
7
  property :floor
8
8
  property :gte_date
9
+ property :hits
9
10
  property :keyword
10
11
  property :lte_date
11
12
  property :mono_stock
13
+ property :offset
12
14
  property :service
13
15
  property :site
14
16
  property :sort
@@ -47,6 +49,11 @@ module Rdmm
47
49
  end
48
50
  end
49
51
 
52
+ # @return [Integer, nil]
53
+ def hits
54
+ options[:hits]
55
+ end
56
+
50
57
  # @return [String, nil]
51
58
  def keyword
52
59
  options[:keyword]
@@ -69,6 +76,11 @@ module Rdmm
69
76
  options[:mono_stock]
70
77
  end
71
78
 
79
+ # @return [Integer, nil]
80
+ def offset
81
+ options[:offset]
82
+ end
83
+
72
84
  # @note service code
73
85
  # @return [String, nil]
74
86
  def service
@@ -0,0 +1,30 @@
1
+ module Rdmm
2
+ module Queries
3
+ class ListMakersQuery < BaseQuery
4
+ property :floor_id
5
+ property :hits
6
+ property :initial
7
+ property :offset
8
+
9
+ # @return [Integer, nil]
10
+ def floor_id
11
+ options[:floor_id]
12
+ end
13
+
14
+ # @return [Integer, nil]
15
+ def hits
16
+ options[:hits]
17
+ end
18
+
19
+ # @return [String, nil]
20
+ def initial
21
+ options[:initial]
22
+ end
23
+
24
+ # @return [Integer, nil]
25
+ def offset
26
+ options[:offset]
27
+ end
28
+ end
29
+ end
30
+ end
@@ -2,17 +2,29 @@ module Rdmm
2
2
  module Queries
3
3
  class ListSeriesQuery < BaseQuery
4
4
  property :floor_id
5
+ property :hits
5
6
  property :initial
7
+ property :offset
6
8
 
7
9
  # @return [Integer, nil]
8
10
  def floor_id
9
11
  options[:floor_id]
10
12
  end
11
13
 
14
+ # @return [Integer, nil]
15
+ def hits
16
+ options[:hits]
17
+ end
18
+
12
19
  # @return [String, nil]
13
20
  def initial
14
21
  options[:initial]
15
22
  end
23
+
24
+ # @return [Integer, nil]
25
+ def offset
26
+ options[:offset]
27
+ end
16
28
  end
17
29
  end
18
30
  end
@@ -0,0 +1,109 @@
1
+ require "date"
2
+
3
+ module Rdmm
4
+ module Resources
5
+ class ActressResource < BaseResource
6
+ # @return [Date, nil]
7
+ def birthday
8
+ if source["birthday"]
9
+ ::Date.parse(source["birthday"])
10
+ end
11
+ end
12
+
13
+ # @return [String, nil]
14
+ def blood_type
15
+ source["blood_type"]
16
+ end
17
+
18
+ # @return [Integer, nil]
19
+ def bust
20
+ source["bust"]
21
+ end
22
+
23
+ # @return [String, nil]
24
+ def cup
25
+ source["cup"]
26
+ end
27
+
28
+ # @return [Integer, nil]
29
+ def height
30
+ source["height"]
31
+ end
32
+
33
+ # @return [Array<String>]
34
+ def hobbies
35
+ if source["hobby"]
36
+ source["hobby"].split("、")
37
+ else
38
+ []
39
+ end
40
+ end
41
+
42
+ # @return [Integer, nil]
43
+ def id
44
+ source["id"]
45
+ end
46
+
47
+ # @return [String, nil]
48
+ def image_url_large
49
+ if source["imageURL"]
50
+ source["imageURL"]["large"]
51
+ end
52
+ end
53
+
54
+ # @return [String, nil]
55
+ def image_url_small
56
+ if source["imageURL"]
57
+ source["imageURL"]["small"]
58
+ end
59
+ end
60
+
61
+ # @return [String, nil]
62
+ def list_url_digital
63
+ source["listURL"]["digital"]
64
+ end
65
+
66
+ # @return [String, nil]
67
+ def list_url_mono
68
+ source["listURL"]["mono"]
69
+ end
70
+
71
+ # @return [String, nil]
72
+ def list_url_monthly
73
+ source["listURL"]["monthly"]
74
+ end
75
+
76
+ # @return [String, nil]
77
+ def list_url_ppm
78
+ source["listURL"]["ppm"]
79
+ end
80
+
81
+ # @return [String, nil]
82
+ def list_url_rental
83
+ source["listURL"]["rental"]
84
+ end
85
+
86
+ # @return [String, nil]
87
+ def name
88
+ source["name"]
89
+ end
90
+
91
+ # @return [String, nil]
92
+ def prefectures
93
+ unless source["prefectures"].nil? || source["prefectures"].empty?
94
+ source["prefectures"]
95
+ end
96
+ end
97
+
98
+ # @return [String, nil]
99
+ def ruby
100
+ source["ruby"]
101
+ end
102
+
103
+ # @return [Integer, nil]
104
+ def waist
105
+ source["waist"]
106
+ end
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,30 @@
1
+ module Rdmm
2
+ module Resources
3
+ class AuthorResource < BaseResource
4
+ # @return [String, nil]
5
+ def another_name
6
+ source["another_name"]
7
+ end
8
+
9
+ # @return [Integer, nil]
10
+ def id
11
+ source["author_id"]
12
+ end
13
+
14
+ # @return [String, nil]
15
+ def list_url
16
+ source["list_url"]
17
+ end
18
+
19
+ # @return [String, nil]
20
+ def name
21
+ source["name"]
22
+ end
23
+
24
+ # @return [String, nil]
25
+ def ruby
26
+ source["ruby"]
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,40 @@
1
+ module Rdmm
2
+ module Resources
3
+ class FloorResource < BaseResource
4
+ # @return [String, nil]
5
+ def code
6
+ source["code"]
7
+ end
8
+
9
+ # @return [Integer, nil]
10
+ def id
11
+ source["id"]
12
+ end
13
+
14
+ # @return [String, nil]
15
+ def name
16
+ source["name"]
17
+ end
18
+
19
+ # @return [String, nil]
20
+ def service_code
21
+ source["service_code"]
22
+ end
23
+
24
+ # @return [String, nil]
25
+ def service_name
26
+ source["service_name"]
27
+ end
28
+
29
+ # @return [String, nil]
30
+ def site_code
31
+ source["site_code"]
32
+ end
33
+
34
+ # @return [String, nil]
35
+ def site_name
36
+ source["site_name"]
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,26 @@
1
+ module Rdmm
2
+ module Resources
3
+ class GenreResource < BaseResource
4
+ # @return [Integer, nil]
5
+ def id
6
+ source["genre_id"]
7
+ end
8
+
9
+ # @return [String, nil]
10
+ def list_url
11
+ source["list_url"]
12
+ end
13
+
14
+ # @return [String, nil]
15
+ def name
16
+ source["name"]
17
+ end
18
+
19
+ # @return [String, nil]
20
+ def ruby
21
+ source["ruby"]
22
+ end
23
+
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,25 @@
1
+ module Rdmm
2
+ module Resources
3
+ class MakerResource < BaseResource
4
+ # @return [Integer, nil]
5
+ def id
6
+ source["maker_id"]
7
+ end
8
+
9
+ # @return [String, nil]
10
+ def list_url
11
+ source["list_url"]
12
+ end
13
+
14
+ # @return [String, nil]
15
+ def name
16
+ source["name"]
17
+ end
18
+
19
+ # @return [String, nil]
20
+ def ruby
21
+ source["ruby"]
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,6 +1,11 @@
1
1
  module Rdmm
2
2
  module Resources
3
3
  class SeriesResource < BaseResource
4
+ # @return [Integer]
5
+ def id
6
+ source["series_id"]
7
+ end
8
+
4
9
  # @return [String]
5
10
  def list_url
6
11
  source["list_url"]
@@ -15,11 +20,6 @@ module Rdmm
15
20
  def ruby
16
21
  source["ruby"]
17
22
  end
18
-
19
- # @return [Integer]
20
- def series_id
21
- source["series_id"]
22
- end
23
23
  end
24
24
  end
25
25
  end
@@ -0,0 +1,12 @@
1
+ module Rdmm
2
+ module Responses
3
+ class ListActressesResponse < BaseResponse
4
+ # @note Override
5
+ def resources
6
+ body["result"]["actress"].map do |source|
7
+ ::Rdmm::Resources::ActressResource.new(source)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module Rdmm
2
+ module Responses
3
+ class ListAuthorsResponse < BaseResponse
4
+ # @note Override
5
+ def resources
6
+ (body["result"]["author"] || []).map do |source|
7
+ ::Rdmm::Resources::AuthorResource.new(source)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,23 @@
1
+ module Rdmm
2
+ module Responses
3
+ class ListFloorsResponse < BaseResponse
4
+ # @note Override
5
+ def resources
6
+ body["result"]["site"].flat_map do |site_source|
7
+ site_source["service"].flat_map do |service_source|
8
+ service_source["floor"].map do |source|
9
+ ::Rdmm::Resources::FloorResource.new(
10
+ source.merge(
11
+ "site_code" => site_source["code"],
12
+ "site_name" => site_source["name"],
13
+ "service_code" => service_source["code"],
14
+ "service_name" => service_source["name"],
15
+ ),
16
+ )
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,12 @@
1
+ module Rdmm
2
+ module Responses
3
+ class ListGenresResponse < BaseResponse
4
+ # @note Override
5
+ def resources
6
+ body["result"]["genre"].map do |source|
7
+ ::Rdmm::Resources::GenreResource.new(source)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module Rdmm
2
+ module Responses
3
+ class ListMakersResponse < BaseResponse
4
+ # @note Override
5
+ def resources
6
+ body["result"]["maker"].map do |source|
7
+ ::Rdmm::Resources::MakerResource.new(source)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module Rdmm
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -7,14 +7,15 @@ Gem::Specification.new do |spec|
7
7
  spec.version = Rdmm::VERSION
8
8
  spec.authors = ["Ryo Nakamura"]
9
9
  spec.email = ["r7kamura@gmail.com"]
10
- spec.summary = "An API Client library for DMM written in Ruby."
10
+ spec.summary = "An API Client library for DMM Web Service written in Ruby."
11
11
  spec.homepage = "https://github.com/r7kamura/rdmm"
12
12
  spec.license = "MIT"
13
13
 
14
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
14
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
15
15
  f.match(%r{^(test|spec|features)/})
16
16
  end
17
17
  spec.require_paths = ["lib"]
18
+ spec.required_ruby_version = ">= 2.2.2"
18
19
 
19
20
  spec.add_dependency "faraday"
20
21
  spec.add_dependency "faraday_middleware"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdmm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-07 00:00:00.000000000 Z
11
+ date: 2017-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -111,13 +111,28 @@ files:
111
111
  - lib/rdmm.rb
112
112
  - lib/rdmm/client.rb
113
113
  - lib/rdmm/queries/base_query.rb
114
+ - lib/rdmm/queries/list_actresses_query.rb
115
+ - lib/rdmm/queries/list_authors_query.rb
116
+ - lib/rdmm/queries/list_floors_query.rb
117
+ - lib/rdmm/queries/list_genres_query.rb
114
118
  - lib/rdmm/queries/list_items_query.rb
119
+ - lib/rdmm/queries/list_makers_query.rb
115
120
  - lib/rdmm/queries/list_series_query.rb
121
+ - lib/rdmm/resources/actress_resource.rb
122
+ - lib/rdmm/resources/author_resource.rb
116
123
  - lib/rdmm/resources/base_resource.rb
124
+ - lib/rdmm/resources/floor_resource.rb
125
+ - lib/rdmm/resources/genre_resource.rb
117
126
  - lib/rdmm/resources/item_resource.rb
127
+ - lib/rdmm/resources/maker_resource.rb
118
128
  - lib/rdmm/resources/series_resource.rb
119
129
  - lib/rdmm/responses/base_response.rb
130
+ - lib/rdmm/responses/list_actresses_response.rb
131
+ - lib/rdmm/responses/list_authors_response.rb
132
+ - lib/rdmm/responses/list_floors_response.rb
133
+ - lib/rdmm/responses/list_genres_response.rb
120
134
  - lib/rdmm/responses/list_items_response.rb
135
+ - lib/rdmm/responses/list_makers_response.rb
121
136
  - lib/rdmm/responses/list_series_response.rb
122
137
  - lib/rdmm/version.rb
123
138
  - rdmm.gemspec
@@ -133,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
148
  requirements:
134
149
  - - ">="
135
150
  - !ruby/object:Gem::Version
136
- version: '0'
151
+ version: 2.2.2
137
152
  required_rubygems_version: !ruby/object:Gem::Requirement
138
153
  requirements:
139
154
  - - ">="
@@ -144,5 +159,5 @@ rubyforge_project:
144
159
  rubygems_version: 2.5.2
145
160
  signing_key:
146
161
  specification_version: 4
147
- summary: An API Client library for DMM written in Ruby.
162
+ summary: An API Client library for DMM Web Service written in Ruby.
148
163
  test_files: []