music_today_api_wrapper 21.12.15.01 → 22.12.15.01

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: 436e40cd69c01b51589fd255bfa98de8f0eae9eb
4
- data.tar.gz: fa26c05c6513d2c945e6153c53201f6de3ce5712
3
+ metadata.gz: b670e5d9e8d88a3dfb228e043105c42cc2b41160
4
+ data.tar.gz: a4de60be3bdf2fe0914a3115b96222c95d2439da
5
5
  SHA512:
6
- metadata.gz: 15de1268c030520ad96119c68be3973d61301c95d1e4bdef6df1fd5f8287068bef156eec620574257b7c655d1807231307c5927682c6fc913ab8e2658425436b
7
- data.tar.gz: 67bcc64e2808a708ae7f746a0b8c2f1a3fc0c0c8b1f471cab5fa0b4178996ef3db6ffd8e2c94ab018bfd5d767a12b8ee6da71018cb50d54b2077fb818c3b8577
6
+ metadata.gz: 1b7c4eb3c514036871506cf8e5c4fb47e7a8571bd70373342260555f5e5a4496a475c77bd8f9f7a9c7566fd3330b5d9a39b5b863391d3df119de063610459f43
7
+ data.tar.gz: bce782e82917e6e5182f08610048ab84b41cb19b66ccfdc2ff61083115313d232f2a60ae453b2f71ffea2f7d090e9c897c2343c7539d38d3f3fcb88174bcea01
@@ -12,9 +12,9 @@ module MusicTodayApiWrapper
12
12
  yield(configuration)
13
13
  end
14
14
 
15
- def self.products
15
+ def self.products(per_page = nil, page_number = nil)
16
16
  product_services = Services::ProductServices.new
17
- product_services.all_products
17
+ product_services.all_products(per_page, page_number)
18
18
  end
19
19
 
20
20
  def self.find_product(id)
@@ -7,7 +7,6 @@ module MusicTodayApiWrapper
7
7
  :quantity_available,
8
8
  :variant_names
9
9
 
10
- # rubocop:disable ParameterLists
11
10
  def initialize(sku, price, quantity_available, variant_names = [])
12
11
  @sku = sku
13
12
  @price = price
@@ -16,7 +15,6 @@ module MusicTodayApiWrapper
16
15
  end
17
16
 
18
17
  def self.from_hash(variant_hash)
19
- size, format, bitrate = nil
20
18
  variant_names = []
21
19
 
22
20
  variant_hash['variantNames'].each do |variant|
@@ -16,10 +16,14 @@ module MusicTodayApiWrapper
16
16
  @common_response = MusicTodayApiWrapper::RestClients::CommonResponse.new
17
17
  end
18
18
 
19
- def all_products
19
+ def all_products(per_page = nil, page_number = nil)
20
20
  @common_response.work do
21
+ options = {}
22
+ options[:size] = per_page if per_page
23
+ options[:page] = page_number if page_number
24
+
21
25
  url = "#{@url}/catalog/content/#{@catalog_number}/"
22
- @common_response.data[:products] = get(url)['products']
26
+ @common_response.data[:products] = get(url, options)['products']
23
27
  end
24
28
  end
25
29
 
@@ -10,8 +10,8 @@ module MusicTodayApiWrapper
10
10
  @rest_client = MusicTodayApiWrapper::RestClient.new
11
11
  end
12
12
 
13
- def all_products
14
- results = @rest_client.all_products
13
+ def all_products(per_page = nil, page_number = nil)
14
+ results = @rest_client.all_products(per_page, page_number)
15
15
  return results unless results.success?
16
16
 
17
17
  @common_response.data[:products] = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: music_today_api_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 21.12.15.01
4
+ version: 22.12.15.01
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Gonzaga
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-21 00:00:00.000000000 Z
12
+ date: 2015-12-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -183,20 +183,6 @@ dependencies:
183
183
  - - ">="
184
184
  - !ruby/object:Gem::Version
185
185
  version: 1.8.3
186
- - !ruby/object:Gem::Dependency
187
- name: facets
188
- requirement: !ruby/object:Gem::Requirement
189
- requirements:
190
- - - "~>"
191
- - !ruby/object:Gem::Version
192
- version: '3.0'
193
- type: :runtime
194
- prerelease: false
195
- version_requirements: !ruby/object:Gem::Requirement
196
- requirements:
197
- - - "~>"
198
- - !ruby/object:Gem::Version
199
- version: '3.0'
200
186
  description: Gem to expose music today api endpoints.
201
187
  email: pgonzaga.uy@gmail.com
202
188
  executables: []