moneybird 0.6.0 → 0.7.0

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: 846b29746f90e00097787629974ce1b80163ddb4
4
- data.tar.gz: c52e1b92441a63cfbf36a2eba7e983c382c54354
3
+ metadata.gz: a8eab1f7d579d0a6d670fb28f8e00cf6680861d2
4
+ data.tar.gz: caa8e3f8905cc3a0d76b4b8e392a0855152d89f5
5
5
  SHA512:
6
- metadata.gz: 3c7c2c4fc5edb72e436eeacdb4479fa4b95975dac947be9a22b307a662cb1a77b2e0ffcad3901d7fb672fa43c1d0af9b68d7c78f68e773dd0ebdd6b70c74f64d
7
- data.tar.gz: 83e5c02cd7d4a92156af320e9c87f8c0b730ff6065d99ce70c5e0bb5bf97324e91ccb651bcdac6af55589395a0cc282d931fc99f8bac5883b0e48263fc1038c2
6
+ metadata.gz: e1eec306c6aa65cf1406ea0043a13919f2eebd2207e548807019b7a5ddb429e4a267f48172f0e2337b532e6334a2a1497aa09e990d29fb15c93817ff574d53e6
7
+ data.tar.gz: f00f7196f3669a660706eb4c9d0b89310a41fb4708519d94055ca4b02accd7635d04afc4778cd857c23a5278c8d6814d60e62893e8915e10a8178b1ad3e5b861
data/bin/console CHANGED
@@ -2,13 +2,12 @@
2
2
 
3
3
  require "bundler/setup"
4
4
  require "moneybird"
5
+ require "irb"
5
6
 
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
7
+ if ENV['MONEYBIRD_API_TOKEN']
8
+ @client = Moneybird::Client.new(ENV['MONEYBIRD_API_TOKEN'])
9
+ end
12
10
 
13
- require "irb"
14
11
  IRB.start
12
+
13
+
data/lib/moneybird.rb CHANGED
@@ -18,6 +18,7 @@ require "moneybird/client"
18
18
  require "moneybird/resource"
19
19
  require "moneybird/resource/invoice/details"
20
20
  require "moneybird/resource/generic/note"
21
+ require "moneybird/resource/generic/event"
21
22
  require "moneybird/webhook"
22
23
 
23
24
  resources = %w(
@@ -19,8 +19,9 @@ module Moneybird
19
19
  def http
20
20
  @http ||= begin
21
21
  uri = uri_for_path(base_url)
22
- http = Net::HTTP.new(uri.host, uri.port)
22
+ http = Net::HTTP.new(uri.host, uri.port, '192.168.2.2', 9396)
23
23
  http.use_ssl = uri.scheme == 'https'
24
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
24
25
  http
25
26
  end
26
27
  end
@@ -5,6 +5,7 @@ module Moneybird::Resource
5
5
 
6
6
  has_attributes %i(
7
7
  id
8
+ administration_id
8
9
  company_name
9
10
  firstname
10
11
  lastname
@@ -47,6 +48,10 @@ module Moneybird::Resource
47
48
  def notes=(notes)
48
49
  @notes ||= notes.map{ |note| Moneybird::Resource::Generic::Note.build(note) }
49
50
  end
51
+
52
+ def events=(events)
53
+ @events ||= events.map{ |event| Moneybird::Resource::Generic::Event.build(event) }
54
+ end
50
55
  end
51
56
  end
52
57
 
@@ -5,6 +5,7 @@ module Moneybird::Resource
5
5
 
6
6
  has_attributes %i(
7
7
  id
8
+ administration_id
8
9
  name
9
10
  identity_id
10
11
  default
@@ -5,6 +5,7 @@ module Moneybird::Resource
5
5
 
6
6
  has_attributes %i(
7
7
  id
8
+ administration_id
8
9
  contact_id
9
10
  contact
10
11
  details
@@ -5,6 +5,7 @@ module Moneybird::Resource
5
5
 
6
6
  has_attributes %i(
7
7
  id
8
+ administration_id
8
9
  type
9
10
  name
10
11
  identifier
@@ -5,6 +5,7 @@ module Moneybird::Resource
5
5
 
6
6
  has_attributes %i(
7
7
  id
8
+ administration_id
8
9
  amount
9
10
  code
10
11
  date
@@ -0,0 +1,17 @@
1
+ module Moneybird::Resource::Generic
2
+ class Event
3
+ include Moneybird::Resource
4
+ extend Moneybird::Resource::ClassMethods
5
+
6
+ has_attributes %i(
7
+ user_id
8
+ administration_id
9
+ action
10
+ link_entity_id
11
+ link_entity_type
12
+ data
13
+ created_at
14
+ updated_at
15
+ )
16
+ end
17
+ end
@@ -5,6 +5,7 @@ module Moneybird::Resource::Generic
5
5
 
6
6
  has_attributes %i(
7
7
  id
8
+ administration_id
8
9
  entity_id
9
10
  entity_type
10
11
  user_id
@@ -5,6 +5,7 @@ module Moneybird::Resource
5
5
 
6
6
  has_attributes %i(
7
7
  id
8
+ administration_id
8
9
  company_name
9
10
  city
10
11
  country
@@ -5,6 +5,7 @@ module Moneybird::Resource::Invoice
5
5
 
6
6
  has_attributes %i(
7
7
  tax_rate_id
8
+ administration_id
8
9
  ledger_account_id
9
10
  amount
10
11
  price
@@ -5,6 +5,7 @@ module Moneybird::Resource
5
5
 
6
6
  has_attributes %i(
7
7
  id
8
+ administration_id
8
9
  name
9
10
  account_type
10
11
  account_id
@@ -11,6 +11,7 @@ module Moneybird::Resource
11
11
  ledger_account_id
12
12
  created_at
13
13
  updated_at
14
+ administration_id
14
15
  )
15
16
  end
16
17
  end
@@ -6,6 +6,7 @@ module Moneybird::Resource
6
6
 
7
7
  has_attributes %i(
8
8
  id
9
+ administration_id
9
10
  contact_id
10
11
  contact
11
12
  workflow_id
@@ -48,6 +49,10 @@ module Moneybird::Resource
48
49
  def details=(line_items)
49
50
  @details ||= line_items.map{ |line_item| Moneybird::Resource::Invoice::Details.build(line_item) }
50
51
  end
52
+
53
+ def events=(events)
54
+ @events ||= events.map{ |event| Moneybird::Resource::Generic::Event.build(event) }
55
+ end
51
56
  end
52
57
  end
53
58
 
@@ -5,6 +5,7 @@ module Moneybird::Resource
5
5
 
6
6
  has_attributes %i(
7
7
  attachments
8
+ administration_id
8
9
  contact
9
10
  contact_id
10
11
  created_at
@@ -51,6 +52,10 @@ module Moneybird::Resource
51
52
  def details=(line_items)
52
53
  @details ||= line_items.map{ |line_item| Moneybird::Resource::Invoice::Details.build(line_item) }
53
54
  end
55
+
56
+ def events=(events)
57
+ @events ||= events.map{ |event| Moneybird::Resource::Generic::Event.build(event) }
58
+ end
54
59
  end
55
60
  end
56
61
 
@@ -5,6 +5,7 @@ module Moneybird::Resource
5
5
 
6
6
  has_attributes %i(
7
7
  id
8
+ administration_id
8
9
  name
9
10
  percentage
10
11
  tax_rate_type
@@ -5,6 +5,7 @@ module Moneybird::Resource
5
5
 
6
6
  has_attributes %i(
7
7
  id
8
+ administration_id
8
9
  url
9
10
  last_http_status
10
11
  last_http_body
@@ -5,6 +5,7 @@ module Moneybird::Resource
5
5
 
6
6
  has_attributes %i(
7
7
  id
8
+ administration_id
8
9
  type
9
10
  name
10
11
  default
@@ -1,7 +1,7 @@
1
1
  module Moneybird
2
2
  module Traits
3
3
  module Delete
4
- DELETE_SUCCESS_CODE = 200
4
+ DELETE_SUCCESS_CODE = 204
5
5
 
6
6
  def delete(resource)
7
7
  client.delete(resource_path(resource))
@@ -1,3 +1,3 @@
1
1
  module Moneybird
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
data/moneybird.gemspec CHANGED
@@ -23,4 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", "~> 1.11"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
25
  spec.add_development_dependency "codeclimate-test-reporter"
26
+ spec.add_development_dependency "minitest"
27
+
26
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moneybird
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten van Vliet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-26 00:00:00.000000000 Z
11
+ date: 2016-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: 'Library to interface with Moneybird API: http://developer.moneybird.com/'
56
70
  email:
57
71
  - maartenvanvliet@gmail.com
@@ -81,6 +95,7 @@ files:
81
95
  - lib/moneybird/resource/estimate.rb
82
96
  - lib/moneybird/resource/financial_account.rb
83
97
  - lib/moneybird/resource/financial_mutation.rb
98
+ - lib/moneybird/resource/generic/event.rb
84
99
  - lib/moneybird/resource/generic/note.rb
85
100
  - lib/moneybird/resource/identity.rb
86
101
  - lib/moneybird/resource/invoice/details.rb
@@ -134,9 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
149
  version: '0'
135
150
  requirements: []
136
151
  rubyforge_project:
137
- rubygems_version: 2.2.2
152
+ rubygems_version: 2.6.3
138
153
  signing_key:
139
154
  specification_version: 4
140
155
  summary: Library to interface with Moneybird API
141
156
  test_files: []
142
- has_rdoc: