recurly 2.18.3 → 2.18.4

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
  SHA256:
3
- metadata.gz: 1a3231398510bdfe53ef4dc1409033d1b526df8a5131bd3bdbf464e80ad3c112
4
- data.tar.gz: ae663af432bea91f8b53da68236753e04ea1081ffd02f421bb32253df94fda5b
3
+ metadata.gz: 83f25e1dee86f19b00a000d486f4aa1b6b9d272d0ace3406e957e5dd1b378c6c
4
+ data.tar.gz: d50f4e39c520d51451361401657cab79dd566adcdfea46d4adead9334e34feb3
5
5
  SHA512:
6
- metadata.gz: c4a128e615bd56e65e7bab7be1e2d28ad0388f5f825e0bf934c659b41eab17cede3f232c5acb47801b0f53f633671add39ef30d6672843b2b2dc6acd32b7b6e9
7
- data.tar.gz: 312dd60e5df037c75091641f0bc5f2cf80da097f2373a5336398ee1ab9fef7a46a8ca31327191718b2df04d796b46f488ddbafcecc566631b00bde75032243db
6
+ metadata.gz: 977e9116f4842904d48ad5bd26927e75f0fbf7f8b86471bbf15208da3cc47a6895ea7b38dddf5eb040d6953626d749e1ccbc3feb7ae33bfaf7ff8cdfd5c1b1d4
7
+ data.tar.gz: 610d7903d45e8a4340c76170ad17667f70e5b004e0e90fe445c7ee674b196f9e006ecbbc5cd3ff32bf9ae1ea94a40f413905362af512e750e6cece72648cffa7
data/README.md CHANGED
@@ -14,7 +14,7 @@ Recurly is packaged as a Ruby gem. We recommend you install it with
14
14
  [Bundler](http://gembundler.com/) by adding the following line to your Gemfile:
15
15
 
16
16
  ``` ruby
17
- gem 'recurly', '~> 2.18.3'
17
+ gem 'recurly', '~> 2.18.4'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
data/lib/recurly.rb CHANGED
@@ -21,6 +21,7 @@ module Recurly
21
21
  require 'recurly/helper'
22
22
  require 'recurly/invoice'
23
23
  require 'recurly/invoice_collection'
24
+ require 'recurly/item'
24
25
  require 'recurly/js'
25
26
  require 'recurly/money'
26
27
  require 'recurly/measured_unit'
@@ -36,6 +36,7 @@ module Recurly
36
36
  total_in_cents
37
37
  currency
38
38
  product_code
39
+ item_code
39
40
  start_date
40
41
  end_date
41
42
  created_at
data/lib/recurly/api.rb CHANGED
@@ -18,7 +18,7 @@ module Recurly
18
18
  @@base_uri = "https://api.recurly.com/v2/"
19
19
  @@valid_domains = [".recurly.com"]
20
20
 
21
- RECURLY_API_VERSION = '2.22'
21
+ RECURLY_API_VERSION = '2.24'
22
22
 
23
23
  FORMATS = Helper.hash_with_indifferent_read_access(
24
24
  'pdf' => 'application/pdf',
@@ -0,0 +1,37 @@
1
+ module Recurly
2
+ class Item < Resource
3
+ # @return [[CustomField], []]
4
+ has_many :custom_fields, class_name: :CustomField, readonly: false
5
+
6
+ define_attribute_methods %w(
7
+ item_code
8
+ name
9
+ description
10
+ external_sku
11
+ accounting_code
12
+ revenue_schedule_type
13
+ state
14
+ created_at
15
+ updated_at
16
+ deleted_at
17
+ )
18
+
19
+ def changed_attributes
20
+ attrs = super
21
+ if custom_fields.any?(&:changed?)
22
+ attrs['custom_fields'] = custom_fields.select(&:changed?)
23
+ end
24
+ attrs
25
+ end
26
+
27
+ # method should be changed to use a link once it is added to api
28
+ # example:
29
+ # return false unless link? :reactivate
30
+ # reload follow_link :reactivate
31
+ def reactivate
32
+ reload API.put("#{uri}/reactivate")
33
+ true
34
+ end
35
+
36
+ end
37
+ end
@@ -1,6 +1,6 @@
1
1
  module Recurly
2
2
  module Version
3
- VERSION = "2.18.3"
3
+ VERSION = "2.18.4"
4
4
 
5
5
  class << self
6
6
  def inspect
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recurly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.18.3
4
+ version: 2.18.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-22 00:00:00.000000000 Z
11
+ date: 2019-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -228,6 +228,7 @@ files:
228
228
  - lib/recurly/helper.rb
229
229
  - lib/recurly/invoice.rb
230
230
  - lib/recurly/invoice_collection.rb
231
+ - lib/recurly/item.rb
231
232
  - lib/recurly/js.rb
232
233
  - lib/recurly/juris_detail.rb
233
234
  - lib/recurly/measured_unit.rb