cameroncox-mousetrap 0.5.3.5 → 0.5.3.6

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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/mousetrap/subscription.rb +13 -10
  3. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.3.5
1
+ 0.5.3.6
@@ -54,19 +54,22 @@ module Mousetrap
54
54
 
55
55
  def current_invoice
56
56
  invoice_record = if invoices.kind_of?(Array)
57
- invoices['invoice'].first
57
+ Invoice.new({
58
+ :id => invoices['invoice'][0]['id'],
59
+ :number => invoices['invoice'][0]['number'],
60
+ :created_at => invoices['invoice'][0]['createdDatetime']
61
+ :billing_date => invoices['invoice'][0]['billingDatetime']
62
+ })
58
63
  else
59
- invoices['invoice']
64
+ Invoice.new({
65
+ :id => invoices['invoice']['id'],
66
+ :number => invoices['invoice']['number'],
67
+ :created_at => invoices['invoice']['createdDatetime']
68
+ :billing_date => invoices['invoice']['billingDatetime']
69
+ })
60
70
  end
61
71
 
62
- attributes = {
63
- :id => invoice_record['id'],
64
- :number => invoice_record['number'],
65
- :created_at => invoice_record['createdDatetime'],
66
- :billing_date => invoice_record['billingDatetime']
67
- }
68
-
69
- Invoice.new(attributes)
72
+ invoice_record
70
73
  end
71
74
 
72
75
  def attributes_for_api
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cameroncox-mousetrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3.5
4
+ version: 0.5.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Larkowski