oneaccess 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b3213f560c414b929e43bca013e0eec25d99219
4
- data.tar.gz: 0d8b39ab276eeffa5c94b6230ce6705a63ced999
3
+ metadata.gz: a86286aac946e3b41df454ba64905d00aa26e582
4
+ data.tar.gz: c0c8a438006f0a13ea150478be4e4d1294909d45
5
5
  SHA512:
6
- metadata.gz: 10c3a85a0d6d80325b6326b07b34bc3a4a7b9b2235a925117bc3bc50e89723b7ae31c727aab357e2b7144faf332d8ca69014528e25ef3b0f95dfb973e261362f
7
- data.tar.gz: a799f9ce81142ec26b1341d38caf89a01c461523fe7e52fb9fc38a9f2f2e7574bbc728682bed25f3506691252898a05157648351a480987c723fc0beaf723ea6
6
+ metadata.gz: 31b5ba3690935496836d40de615e9b67d281131541073bf94280350c7242dc18e21b14297b76a145dffd7b78b8b083eaed5a0f5281d6940bca339c2d26fdc893
7
+ data.tar.gz: 9b0b62d7ff71bc8549fbf50239cc181f8666a36a2653fa47ac94630d908cbd462a17a0489ebfb9c1af3f844820d022b6f432cb665c027f11cba9128c952d42fc
@@ -1,21 +1,41 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../response/industries_response"
4
+ require_relative "../response/countries_response"
4
5
 
5
6
  module ONEAccess
6
7
  module API
7
8
  class References < Base
8
9
  api_path "/references"
9
10
 
10
- def self.industries(sort_by: "Id", is_ascending: false, keyword: "", page_number: 0, page_size: 20)
11
- resp = send_get("industries", Query: {
12
- SortBy: sort_by,
13
- IsAscending: is_ascending,
14
- Keyword: keyword,
15
- PageNumber: page_number,
16
- PageSize: page_size
17
- }.to_json)
18
- Response::IndustriesResponse.from_json(resp.body)
11
+ class << self
12
+ def industries(sort_by: "Id", is_ascending: false, keyword: "", page_number: 0, page_size: 20)
13
+ query = build_query(sort_by, is_ascending, keyword, page_number, page_size)
14
+
15
+ resp = send_get("industries", Query: query.to_json)
16
+
17
+ Response::IndustriesResponse.from_json(resp.body)
18
+ end
19
+
20
+ def countries(sort_by: "Id", is_ascending: false, keyword: "", page_number: 0, page_size: 20)
21
+ query = build_query(sort_by, is_ascending, keyword, page_number, page_size)
22
+
23
+ resp = send_get("countries", Query: query.to_json)
24
+
25
+ Response::CountriesResponse.from_json(resp.body)
26
+ end
27
+
28
+ private
29
+
30
+ def build_query(sort_by, is_ascending, keyword, page_number, page_size)
31
+ {
32
+ SortBy: sort_by,
33
+ IsAscending: is_ascending,
34
+ Keyword: keyword,
35
+ PageNumber: page_number,
36
+ PageSize: page_size
37
+ }
38
+ end
19
39
  end
20
40
  end
21
41
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./paginated_response"
4
+ require_relative "./representer/countries_response"
5
+
6
+ module ONEAccess
7
+ module Response
8
+ class CountriesResponse < PaginatedResponse
9
+ represented_by Representer::CountriesResponse
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./paginated_response"
4
+ require_relative "../../data_object/industry"
5
+
6
+ module ONEAccess
7
+ module Response
8
+ module Representer
9
+ class CountriesResponse < PaginatedResponse
10
+ collection :data, as: :Data,
11
+ decorator: DataObject::Representer::Country,
12
+ class: DataObject::Country
13
+ end
14
+ end
15
+ end
16
+ end
data/oneaccess.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "oneaccess"
4
- s.version = "0.1.4"
5
- s.date = "2017-12-05"
4
+ s.version = "0.1.5"
5
+ s.date = "2017-12-14"
6
6
  s.summary = "ONEAccess API wrapper"
7
7
  s.description = "Easily communicate with ONEAccess API"
8
8
  s.homepage = "https://github.com/AlphaExchange/rixml"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oneaccess
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Correia Santos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-05 00:00:00.000000000 Z
11
+ date: 2017-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -226,6 +226,7 @@ files:
226
226
  - lib/oneaccess/response/base_response.rb
227
227
  - lib/oneaccess/response/companies_response.rb
228
228
  - lib/oneaccess/response/company_response.rb
229
+ - lib/oneaccess/response/countries_response.rb
229
230
  - lib/oneaccess/response/industries_response.rb
230
231
  - lib/oneaccess/response/organization_response.rb
231
232
  - lib/oneaccess/response/paginated_response.rb
@@ -234,6 +235,7 @@ files:
234
235
  - lib/oneaccess/response/representer/base_response.rb
235
236
  - lib/oneaccess/response/representer/companies_response.rb
236
237
  - lib/oneaccess/response/representer/company_response.rb
238
+ - lib/oneaccess/response/representer/countries_response.rb
237
239
  - lib/oneaccess/response/representer/industries_response.rb
238
240
  - lib/oneaccess/response/representer/organization_response.rb
239
241
  - lib/oneaccess/response/representer/paginated_response.rb