gecko-ruby 0.0.5 → 0.0.6

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: 9c40754a9c277cd08ad49a2d852b695c75fe8c92
4
- data.tar.gz: c2581aaebade775b562ea622f6cda0f3743ebed0
3
+ metadata.gz: 5f9b99f9bdc65fa256ba9aec9b289167e1cc5bc2
4
+ data.tar.gz: c6e482d13237f0b5b7435be4e00fcee405bbd11d
5
5
  SHA512:
6
- metadata.gz: 3d8391b9645867eb544931162bdf71eb962868e94d997b2d16c9344d3f4657e1de29cc8d4de09d1392f5dc80b7d02b40111fbf59dc016ebf8bbdda5009f4266d
7
- data.tar.gz: 6dbec0902e1e46fb6429dc6a6c194e0d4ddcbe1a6a615786cf873b71064431c92e78182ae5e1c07165db3e1fbe3c4941b710fbc5df4145dda0dac7764c3c30be
6
+ metadata.gz: 12031c659b49586e11e3fb32c5736e9ca51b7647009615025ff7dfd87a86babaec8081e10448c74135d8cb28bba17703e90651b730d835a405eeaaf12f7c5567
7
+ data.tar.gz: 336041aae3344a590789428197d79cd93c60bbb45bfa718c08e0bb8c673bffaa6bbd7ba441d466782c129132ab84578ca1fe8203a68a00d6ee952dae92e904ed
@@ -1,4 +1,7 @@
1
- ## Unreleased
1
+ ## 0.0.6 (2015-03-17)
2
+ - Add `Gecko::Record::PaymentTerm`
3
+
4
+ ## 0.0.5 (2015-03-04)
2
5
  - Add size to base adapter
3
6
  - Update serialization_helper to support serializing arrays correctly
4
7
 
@@ -28,4 +28,5 @@ require 'gecko/record/location'
28
28
  require 'gecko/record/user'
29
29
  require 'gecko/record/purchase_order'
30
30
  require 'gecko/record/purchase_order_line_item'
31
- require 'gecko/record/tax_type'
31
+ require 'gecko/record/tax_type'
32
+ require 'gecko/record/payment_term'
@@ -30,6 +30,7 @@ module Gecko
30
30
  record :PurchaseOrder
31
31
  record :PurchaseOrderLineItem
32
32
  record :TaxType
33
+ record :PaymentTerm
33
34
 
34
35
  # Return OAuth client
35
36
  #
@@ -32,9 +32,9 @@ module Gecko
32
32
  belongs_to :primary_location, class_name: "Location"
33
33
  belongs_to :primary_billing_location, class_name: "Location"
34
34
  belongs_to :default_tax_type, class_name: "TaxType"
35
+ belongs_to :default_payment_term, class_name: "PaymentTerm"
35
36
 
36
37
  # belongs_to :default_currency, class_name: "Currency"
37
- # belongs_to :default_payment_term, class_name: "PaymentTerm"
38
38
  # belongs_to :default_purchase_order_price_list, class_name: "PriceList"
39
39
  # belongs_to :default_order_price_list, class_name: "PriceList"
40
40
 
@@ -5,6 +5,7 @@ module Gecko
5
5
  class Company < Base
6
6
  belongs_to :assignee, class_name: "User"
7
7
  belongs_to :default_tax_type, class_name: "TaxType"
8
+ belongs_to :default_payment_term, class_name: "PaymentTerm"
8
9
 
9
10
  has_many :addresses
10
11
  has_many :contacts
@@ -27,7 +28,6 @@ module Gecko
27
28
  attribute :default_discount_rate, BigDecimal
28
29
 
29
30
  # belongs_to :default_price_list, class_name: "PriceList"
30
- # belongs_to :default_payment_term, class_name: "PaymentTerm"
31
31
  end
32
32
 
33
33
  class CompanyAdapter < BaseAdapter
@@ -0,0 +1,16 @@
1
+ require 'gecko/record/base'
2
+
3
+ module Gecko
4
+ module Record
5
+ class PaymentTerm < Base
6
+ attribute :name, String
7
+ attribute :status, String, readonly: true
8
+ attribute :due_in_days, Integer
9
+ attribute :from, String
10
+ end
11
+
12
+ class PaymentTermAdapter < BaseAdapter
13
+
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Gecko
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -0,0 +1,59 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.lvh.me:3000/payment_terms?limit=5
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Gecko/0.0.5 OAuth2/1.0.0 Faraday/0.9.1 Ruby/2.1.5
12
+ Authorization:
13
+ - Bearer 07084fd170b00327dd26e0cff0ff659afc7ada07bec0b58ce91e3f8667cf5ac4
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: 'OK '
22
+ headers:
23
+ X-Frame-Options:
24
+ - ALLOW-FROM https://login.bigcommerce.com
25
+ X-Rate-Limit-Limit:
26
+ - '300'
27
+ X-Rate-Limit-Remaining:
28
+ - '299'
29
+ X-Rate-Limit-Reset:
30
+ - '1426503900'
31
+ X-Pagination:
32
+ - '{"total_records":11,"total_pages":3,"first_page":true,"last_page":false,"out_of_bounds":false,"offset":0}'
33
+ Link:
34
+ - <http://api.lvh.me:3000/ajax/payment_terms?limit=5&page=2>; rel="next", <http://api.lvh.me:3000/ajax/payment_terms?limit=5&page=3>;
35
+ rel="last"
36
+ Content-Type:
37
+ - application/json; charset=utf-8
38
+ Etag:
39
+ - '"f5f819a402b3b2a646d6931a72b7a685"'
40
+ Cache-Control:
41
+ - max-age=0, private, must-revalidate
42
+ X-Request-Id:
43
+ - 258907c7-a514-4e1b-917d-f3b27df2120b
44
+ X-Runtime:
45
+ - '0.248622'
46
+ Server:
47
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
48
+ Date:
49
+ - Mon, 16 Mar 2015 11:02:29 GMT
50
+ Content-Length:
51
+ - '384'
52
+ Connection:
53
+ - Keep-Alive
54
+ body:
55
+ encoding: UTF-8
56
+ string: '{"payment_terms":[{"id":77,"name":"NET55","due_in_days":55,"status":"active","from":"eom"},{"id":76,"name":"NET66","due_in_days":66,"status":"active","from":"now"},{"id":75,"name":"NET45","due_in_days":45,"status":"active","from":"now"},{"id":74,"name":"NET40","due_in_days":40,"status":"active","from":"now"},{"id":73,"name":"NET25","due_in_days":25,"status":"active","from":"now"}]}'
57
+ http_version:
58
+ recorded_at: Mon, 16 Mar 2015 11:02:29 GMT
59
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.lvh.me:3000/payment_terms?limit=0
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Gecko/0.0.5 OAuth2/1.0.0 Faraday/0.9.1 Ruby/2.1.5
12
+ Authorization:
13
+ - Bearer 07084fd170b00327dd26e0cff0ff659afc7ada07bec0b58ce91e3f8667cf5ac4
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: 'OK '
22
+ headers:
23
+ X-Frame-Options:
24
+ - ALLOW-FROM https://login.bigcommerce.com
25
+ X-Rate-Limit-Limit:
26
+ - '300'
27
+ X-Rate-Limit-Remaining:
28
+ - '299'
29
+ X-Rate-Limit-Reset:
30
+ - '1426503900'
31
+ X-Pagination:
32
+ - '{"total_records":11,"total_pages":1,"first_page":true,"last_page":true,"out_of_bounds":false,"offset":0}'
33
+ Link:
34
+ - <http://api.lvh.me:3000/ajax/payment_terms?limit=0&page=1>; rel="last"
35
+ Content-Type:
36
+ - application/json; charset=utf-8
37
+ Etag:
38
+ - '"90d153023966817f5a1e16d9911a7836"'
39
+ Cache-Control:
40
+ - max-age=0, private, must-revalidate
41
+ X-Request-Id:
42
+ - aaa2e657-e260-4136-a07e-a24423cdedf7
43
+ X-Runtime:
44
+ - '0.094520'
45
+ Server:
46
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
47
+ Date:
48
+ - Mon, 16 Mar 2015 11:02:29 GMT
49
+ Content-Length:
50
+ - '20'
51
+ Connection:
52
+ - Keep-Alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"payment_terms":[]}'
56
+ http_version:
57
+ recorded_at: Mon, 16 Mar 2015 11:02:29 GMT
58
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class Gecko::Record::PaymentTermAdapterTest < Minitest::Test
4
+ include TestingAdapter
5
+ include SharedAdapterExamples
6
+
7
+ let(:adapter) { @client.PaymentTerm }
8
+ let(:plural_name) { "payment_terms" }
9
+ let(:record_class) { Gecko::Record::PaymentTerm }
10
+
11
+ def test_initializes_adapter
12
+ assert_instance_of(Gecko::Record::PaymentTermAdapter, @client.PaymentTerm)
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ require 'test_helper'
2
+
3
+ class Gecko::PaymentTermTest < Minitest::Test
4
+ include VCRHelper
5
+ include SharedRecordExamples
6
+
7
+ let(:plural_name) { "payment_terms" }
8
+ let(:record_class) { Gecko::Record::PaymentTerm }
9
+
10
+ def setup
11
+ @json = load_vcr_hash("payment_terms", "payment_terms").first
12
+ @record = record_class.new(client, @json)
13
+ end
14
+
15
+ def test_initializes_record
16
+ assert_instance_of(Gecko::Record::PaymentTerm, @record)
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gecko-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bradley Priest
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-03 00:00:00.000000000 Z
11
+ date: 2015-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -235,6 +235,7 @@ files:
235
235
  - lib/gecko/record/location.rb
236
236
  - lib/gecko/record/order.rb
237
237
  - lib/gecko/record/order_line_item.rb
238
+ - lib/gecko/record/payment_term.rb
238
239
  - lib/gecko/record/product.rb
239
240
  - lib/gecko/record/purchase_order.rb
240
241
  - lib/gecko/record/purchase_order_line_item.rb
@@ -267,6 +268,8 @@ files:
267
268
  - test/fixtures/vcr_cassettes/order_line_items_count.yml
268
269
  - test/fixtures/vcr_cassettes/orders.yml
269
270
  - test/fixtures/vcr_cassettes/orders_count.yml
271
+ - test/fixtures/vcr_cassettes/payment_terms.yml
272
+ - test/fixtures/vcr_cassettes/payment_terms_count.yml
270
273
  - test/fixtures/vcr_cassettes/products.yml
271
274
  - test/fixtures/vcr_cassettes/products_count.yml
272
275
  - test/fixtures/vcr_cassettes/products_new_invalid.yml
@@ -312,6 +315,8 @@ files:
312
315
  - test/record/order_line_item_adapter_test.rb
313
316
  - test/record/order_line_item_test.rb
314
317
  - test/record/order_test.rb
318
+ - test/record/payment_term_adapter_test.rb
319
+ - test/record/payment_term_test.rb
315
320
  - test/record/product_adapter_test.rb
316
321
  - test/record/product_test.rb
317
322
  - test/record/purchase_order_adapter_test.rb
@@ -380,6 +385,8 @@ test_files:
380
385
  - test/fixtures/vcr_cassettes/order_line_items_count.yml
381
386
  - test/fixtures/vcr_cassettes/orders.yml
382
387
  - test/fixtures/vcr_cassettes/orders_count.yml
388
+ - test/fixtures/vcr_cassettes/payment_terms.yml
389
+ - test/fixtures/vcr_cassettes/payment_terms_count.yml
383
390
  - test/fixtures/vcr_cassettes/products.yml
384
391
  - test/fixtures/vcr_cassettes/products_count.yml
385
392
  - test/fixtures/vcr_cassettes/products_new_invalid.yml
@@ -425,6 +432,8 @@ test_files:
425
432
  - test/record/order_line_item_adapter_test.rb
426
433
  - test/record/order_line_item_test.rb
427
434
  - test/record/order_test.rb
435
+ - test/record/payment_term_adapter_test.rb
436
+ - test/record/payment_term_test.rb
428
437
  - test/record/product_adapter_test.rb
429
438
  - test/record/product_test.rb
430
439
  - test/record/purchase_order_adapter_test.rb