fortnox 0.0.1 → 0.0.3
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.
- data/fortnox.gemspec +3 -3
- data/lib/fortnox/invoice.rb +10 -5
- data/lib/fortnox/version.rb +1 -1
- data/spec/integration/invoice_spec.rb +7 -0
- data/spec/spec_helper.rb +1 -0
- metadata +7 -9
data/fortnox.gemspec
CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Fortnox::VERSION
|
8
8
|
s.authors = ["Jonas Arnklint", "Kevin Sjöberg"]
|
9
9
|
s.email = ["jonas@fkw.se", "kev.sjoberg@gmail.com"]
|
10
|
-
s.homepage = ""
|
11
|
-
s.summary = %q{
|
10
|
+
s.homepage = "http://pushforward.se"
|
11
|
+
s.summary = %q{Small Ruby wrapper around Fortnox API}
|
12
12
|
s.description = %q{Handle invoices and customers through the Fortnox API}
|
13
13
|
|
14
14
|
s.rubyforge_project = "fortnox"
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_development_dependency "rspec"
|
22
22
|
s.add_development_dependency "vcr"
|
23
23
|
s.add_development_dependency "webmock"
|
24
|
-
|
24
|
+
|
25
25
|
s.add_runtime_dependency "httparty"
|
26
26
|
s.add_runtime_dependency "gyoku"
|
27
27
|
end
|
data/lib/fortnox/invoice.rb
CHANGED
@@ -11,9 +11,9 @@ module Fortnox
|
|
11
11
|
raise Error, response.body
|
12
12
|
end
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
def update(attributes={})
|
16
|
-
|
16
|
+
response = run :post, :set_invoice, with_root(attributes)
|
17
17
|
response['result'] ? response['result']['id'].to_i : false
|
18
18
|
end
|
19
19
|
|
@@ -21,12 +21,17 @@ module Fortnox
|
|
21
21
|
response = run :post, :set_invoice_cancel, { :query => { :id => id } }
|
22
22
|
response['result'] ? response['result'].to_i : false
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
|
+
def show(id)
|
26
|
+
response = run :get, :get_invoice, { :query => { :id => id } }
|
27
|
+
response['invoice'] ? response['invoice']['status'] : false
|
28
|
+
end
|
29
|
+
|
25
30
|
private
|
26
|
-
|
31
|
+
|
27
32
|
def with_root(attributes)
|
28
33
|
{ :invoice => attributes }
|
29
|
-
|
34
|
+
end
|
30
35
|
end
|
31
36
|
end
|
32
37
|
end
|
data/lib/fortnox/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fortnox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jonas Arnklint
|
@@ -16,8 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-
|
20
|
-
default_executable:
|
19
|
+
date: 2012-11-15 00:00:00 Z
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
23
22
|
name: rspec
|
@@ -119,8 +118,7 @@ files:
|
|
119
118
|
- spec/unit/api_spec.rb
|
120
119
|
- spec/unit/customer_spec.rb
|
121
120
|
- spec/unit/invoice_spec.rb
|
122
|
-
|
123
|
-
homepage: ""
|
121
|
+
homepage: http://pushforward.se
|
124
122
|
licenses: []
|
125
123
|
|
126
124
|
post_install_message:
|
@@ -149,10 +147,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
147
|
requirements: []
|
150
148
|
|
151
149
|
rubyforge_project: fortnox
|
152
|
-
rubygems_version: 1.
|
150
|
+
rubygems_version: 1.8.24
|
153
151
|
signing_key:
|
154
152
|
specification_version: 3
|
155
|
-
summary:
|
153
|
+
summary: Small Ruby wrapper around Fortnox API
|
156
154
|
test_files:
|
157
155
|
- spec/fixtures/invoice.yml
|
158
156
|
- spec/integration/customer_spec.rb
|