billysbilling-rails 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -2
- data/lib/billys_billing/client.rb +3 -4
- data/lib/billys_billing/version.rb +1 -1
- data/lib/billys_billing.rb +2 -1
- data/lib/string.rb +13 -0
- metadata +3 -2
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# billysbilling-rails
|
2
2
|
|
3
|
-
|
3
|
+
An API wrapper for the danish accounting program [Billys Billing](https://dev.billysbilling.dk/api). Se also the homepage of [Billys Billing ](https://billysbilling.dk/)
|
4
4
|
|
5
5
|
READ BILLYS BILLING API TERMS BEFORE USE: https://dev.billysbilling.dk/api-terms
|
6
6
|
|
@@ -43,6 +43,7 @@ If you for some reason need multiple instances of the client and do not want to
|
|
43
43
|
|
44
44
|
## Usage Examples
|
45
45
|
|
46
|
+
```ruby
|
46
47
|
client = BillysBilling.new(api_key: 'abcdefghijklmnopqrstuvxyz123456789')
|
47
48
|
|
48
49
|
product_params = {
|
@@ -64,7 +65,7 @@ product_params = {
|
|
64
65
|
product = client.create_product(product_params)
|
65
66
|
product.description
|
66
67
|
#=> "Very exciting story."
|
67
|
-
|
68
|
+
```
|
68
69
|
|
69
70
|
## Contributing
|
70
71
|
|
@@ -28,8 +28,8 @@ module BillysBilling
|
|
28
28
|
|
29
29
|
def method_missing(method, *arguments, &block)
|
30
30
|
# the first argument is a Symbol, so you need to_s it if you want to pattern match
|
31
|
-
if method.to_s =~ /^(#{valid_actions.join("|")})_(#{valid_queries.join("s?|")})(!?)/
|
32
|
-
send("#{$1}#{$3}", *[$2.
|
31
|
+
if method.to_s =~ /^(#{valid_actions.join("|")})_(#{valid_queries.join("s?|")})(!?)/
|
32
|
+
send("#{$1}#{$3}", *[$2.billyfy].concat(arguments), &block)
|
33
33
|
else
|
34
34
|
super
|
35
35
|
end
|
@@ -82,11 +82,10 @@ module BillysBilling
|
|
82
82
|
|
83
83
|
def index(class_name, params={}, options={})
|
84
84
|
params = {q: params} if params.is_a?(String)
|
85
|
-
|
86
85
|
list = []
|
87
86
|
response = get_request("/#{class_name}", params, options)
|
88
87
|
if response.success?
|
89
|
-
response[class_name].each do |instance|
|
88
|
+
response[class_name.rubyify].each do |instance|
|
90
89
|
list << get_class_instance(class_name, instance)
|
91
90
|
end
|
92
91
|
return list
|
data/lib/billys_billing.rb
CHANGED
data/lib/string.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: billysbilling-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -195,6 +195,7 @@ files:
|
|
195
195
|
- lib/billysbilling-rails.rb
|
196
196
|
- lib/billysbilling.rb
|
197
197
|
- lib/hash.rb
|
198
|
+
- lib/string.rb
|
198
199
|
- spec/billys_billing/base_spec.rb
|
199
200
|
- spec/billys_billing/invoice_spec.rb
|
200
201
|
- spec/billys_billing/request_spec.rb
|