paid 1.0.11 → 1.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: 1db7ca9635617b70d646bb2eeb6535e79b229781
4
- data.tar.gz: 95b28ea31eca3b6dcd72cd746fa710c60feee7e3
3
+ metadata.gz: 5cf60ea77b7acfc99071d6db990d4195175af0ea
4
+ data.tar.gz: f361f3abfc1f00e8bd74eef54d5580e7430f957c
5
5
  SHA512:
6
- metadata.gz: 0632379b0b8daf83f9def3d2a95b3fd893edecefc8da65dcbef79a8c0e74f4d85968dcf4547c41ad68a1fab3d9425c4785a0b11b413454ce82aff6462e72928a
7
- data.tar.gz: 998923c32e3ad0fdb410489020c65735a3d159e1f1ae4e06ef7cf8b72c166e5dd01ab3d96ee579ae61eb0a228323442c9f12258607589b43e4118653c1c35e80
6
+ metadata.gz: bf6b618afcd7f6fafc04c6e0977dc85882a1cd6720448cb2888e46611c672995d4766290ab9a0b5e04acb8700ff6696059022dc8c2485d8a0aeacaa662356e8a
7
+ data.tar.gz: 3147c05ee6c18660ae692cef8e6f46fac39f6c74dc6a59ca2309a07763ca74f825d37724c1ba3e80980edde8f2b15bf2c4c08fa68eb29fb955f01aae150cd6c7
@@ -1,3 +1,10 @@
1
+ === 1.1.0 2015-07-21
2
+
3
+ * 2 enhancements:
4
+ * Adding several attributes to the Invoice
5
+ * Updating API Resources to support undeclared attributes
6
+
7
+
1
8
  === 1.0.11 2015-06-19
2
9
 
3
10
  * 1 minor enhancements:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.11
1
+ 1.1.0
@@ -31,11 +31,12 @@ module Paid
31
31
  @api_method = api_method
32
32
  @json = Util.sorta_deep_clone(json)
33
33
 
34
- # Use json (not the @json, the cloned copy)
34
+ # Use json (not @json, the cloned copy)
35
35
  json.each do |k, v|
36
- if self.class.api_attribute_names.include?(k.to_sym)
37
- instance_variable_set("@#{k}", determine_api_attribute_value(k, v))
36
+ unless self.class.api_attribute_names.include?(k.to_sym)
37
+ self.class.add_api_attribute(k.to_sym)
38
38
  end
39
+ instance_variable_set("@#{k}", determine_api_attribute_value(k, v))
39
40
  end
40
41
  self
41
42
  end
@@ -58,6 +59,11 @@ module Paid
58
59
  @api_attributes.map(&:first)
59
60
  end
60
61
 
62
+ def self.add_api_attribute(name)
63
+ attr_accessor name.to_sym
64
+ @api_attributes[name.to_sym] = {}
65
+ end
66
+
61
67
  def api_attributes
62
68
  ret = {}
63
69
  self.class.api_attribute_names.each do |attribute|
@@ -107,6 +113,7 @@ module Paid
107
113
  raw_value
108
114
  end
109
115
  end
116
+
110
117
  def determine_api_attribute_value(name, raw_value)
111
118
  self.class.determine_api_attribute_value(name, raw_value)
112
119
  end
@@ -2,14 +2,28 @@ module Paid
2
2
  class Invoice < APIResource
3
3
  attr_reader :id
4
4
  attr_reader :object
5
- attr_accessor :summary
5
+ attr_accessor :amount
6
+ attr_accessor :amount_string
6
7
  attr_accessor :chase_schedule
7
- attr_accessor :next_chase_on
8
+ attr_accessor :created_at
8
9
  attr_accessor :customer
10
+ attr_accessor :due_date
9
11
  attr_accessor :issued_at
10
- attr_accessor :terms
12
+ attr_accessor :last_reminder_on
11
13
  attr_accessor :metadata
14
+ attr_accessor :next_chase_on
15
+ attr_accessor :number
16
+ attr_accessor :next_reminder_on
17
+ attr_accessor :overdue_amount
18
+ attr_accessor :paid
19
+ attr_accessor :payment
20
+ attr_accessor :status
21
+ attr_accessor :summary
22
+ attr_accessor :terms
12
23
  attr_accessor :url
24
+ attr_accessor :unpaid_amount
25
+ attr_accessor :views
26
+ attr_accessor :voided
13
27
 
14
28
  def self.all(params={}, headers={})
15
29
  method = APIMethod.new(:get, "/invoices", params, headers, self)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Calhoun
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-19 00:00:00.000000000 Z
12
+ date: 2015-07-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client