fs_api 1.0.7 → 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 +4 -4
- data/README.md +21 -3
- data/Rakefile +9 -0
- data/fs_api.gemspec +1 -0
- data/lib/fs_api.rb +21 -0
- data/lib/fs_api/resource/client.rb +4 -0
- data/lib/fs_api/resource/invoice.rb +1 -0
- data/lib/fs_api/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1951fad1c62c420713d4abb967d1888961748ea6
|
4
|
+
data.tar.gz: 48f5a184ad8cc405a1fd68cda3939850125c6bfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b99dcc61cb0d38f8b2591c70da949ddfe9aada24880e8b30c047ce0e0fe167fc3c1e5fe8fc33c171c937e9398bbe2fd03f7fb90693ecaa26a911414e6fcc6cce
|
7
|
+
data.tar.gz: c31c16c5ec4cd3f64cb5ae9ab90fafcbf4d507f7156d2e49f7fc49051d369a40e94d39b4301d3ae3f5a54852a2321bf60f70f84d4455d4812f1ef2e1a330b680
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
+
[](https://badge.fury.io/rb/fs_api) [](https://travis-ci.org/maartenvanvliet/fs_api)[](https://codeclimate.com/github/maartenvanvliet/fs_api)
|
2
|
+
|
1
3
|
# FsApi
|
2
|
-
|
4
|
+
|
3
5
|
Gem to interface with the [factuursturen.nl](https://www.factuursturen.nl/?a=1552)
|
4
6
|
invoicing API
|
5
7
|
|
@@ -8,8 +10,7 @@ floats/integers/booleans ("true", "1" etc.), for the booleans a conversion is
|
|
8
10
|
in place, for the others there isn't yet.
|
9
11
|
|
10
12
|
Use the docs at https://www.factuursturen.nl/docs/api_v1.pdf for more information
|
11
|
-
on the api. Note that there are inconsistencies between the docs and the
|
12
|
-
implementation.
|
13
|
+
on the api. Note that there are inconsistencies between the docs and what the api actually does. E.g. required fields that are not required.
|
13
14
|
|
14
15
|
|
15
16
|
## Installation
|
@@ -30,9 +31,26 @@ Or install it yourself as:
|
|
30
31
|
|
31
32
|
## Usage
|
32
33
|
|
34
|
+
### Initialization
|
35
|
+
|
33
36
|
```ruby
|
34
37
|
api_client = FsApi::Client.new(username, api_key)
|
38
|
+
```
|
39
|
+
|
40
|
+
or
|
35
41
|
|
42
|
+
```ruby
|
43
|
+
FsApi.configure do |config|
|
44
|
+
config.api_key = '...'
|
45
|
+
config.username = '...'
|
46
|
+
end
|
47
|
+
|
48
|
+
api_client = FsApi.new
|
49
|
+
```
|
50
|
+
|
51
|
+
### After initialization
|
52
|
+
|
53
|
+
```ruby
|
36
54
|
# Retrieve all products
|
37
55
|
api_client.products.all
|
38
56
|
|
data/Rakefile
ADDED
data/fs_api.gemspec
CHANGED
data/lib/fs_api.rb
CHANGED
@@ -15,4 +15,25 @@ require "fs_api/resource/invoices_payment"
|
|
15
15
|
require "fs_api/resource/product"
|
16
16
|
|
17
17
|
module FsApi
|
18
|
+
class << self
|
19
|
+
attr_accessor :configuration
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.configure
|
23
|
+
self.configuration ||= Configuration.new
|
24
|
+
yield(configuration)
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.new
|
28
|
+
FsApi::Client.new(configuration.username, configuration.api_key)
|
29
|
+
end
|
30
|
+
|
31
|
+
class Configuration
|
32
|
+
attr_accessor :username, :api_key
|
33
|
+
|
34
|
+
def initialize
|
35
|
+
@username = nil
|
36
|
+
@api_key = nil
|
37
|
+
end
|
38
|
+
end
|
18
39
|
end
|
data/lib/fs_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fs_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maarten van Vliet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: webmock
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +66,7 @@ files:
|
|
52
66
|
- Gemfile
|
53
67
|
- LICENSE.txt
|
54
68
|
- README.md
|
69
|
+
- Rakefile
|
55
70
|
- fs_api.gemspec
|
56
71
|
- lib/fs_api.rb
|
57
72
|
- lib/fs_api/client.rb
|
@@ -99,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
114
|
version: '0'
|
100
115
|
requirements: []
|
101
116
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.5.2
|
103
118
|
signing_key:
|
104
119
|
specification_version: 4
|
105
120
|
summary: Ruby-Api library for factuursturen.nl
|
@@ -115,4 +130,3 @@ test_files:
|
|
115
130
|
- spec/support/responses/client.json
|
116
131
|
- spec/support/responses/invoice.json
|
117
132
|
- spec/support/responses/product.json
|
118
|
-
has_rdoc:
|