beyonic 0.0.7 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +8 -1
- data/lib/beyonic.rb +2 -2
- data/lib/beyonic/abstract_api.rb +5 -1
- data/lib/beyonic/collection.rb +0 -11
- data/lib/beyonic/contact.rb +5 -0
- data/lib/beyonic/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 781e00604e42a0ffc49de7be99b6edce8f0dda37
|
4
|
+
data.tar.gz: e00d89763bf86fcb71f60287fad0460f0472efa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85c97078967b35e74ac40d1f1c4e3a8eaddd77903812ab05aa8863a77772830444c55123cd0d05d9dabbc33d97a0ff20cee80ab740a570756eb9a296dac3fe5d
|
7
|
+
data.tar.gz: b475f0895c93e60aab4db848907ac4f10f0645861ae4a111031c6a22ce599884421fa3db509a304e36b785e8e85aad956d14b476189e0243f675de6c0d9d78db
|
data/DEVELOPMENT.md
CHANGED
@@ -43,4 +43,11 @@ You can get detailed coverage report at coverage/index.html, after tests has bee
|
|
43
43
|
For mocks [VCR](https://github.com/vcr/vcr) is used.
|
44
44
|
All recorded API interactions cassettes located on fixtures/vcr_cassettes/ folder.
|
45
45
|
|
46
|
-
They can be deleted, in this case on next tests run specs will access to real API and cassettes will be recorded again.
|
46
|
+
They can be deleted, in this case on next tests run specs will access to real API and cassettes will be recorded again.
|
47
|
+
|
48
|
+
## Releasing
|
49
|
+
To release a new version of the gem:
|
50
|
+
- Increment the version in lib/beyonic/version.rb
|
51
|
+
- Push all code
|
52
|
+
- Build the gem with ```gem build beyonic.gemspec```
|
53
|
+
- Push the gem to rubygems with ```gem push beyonic-X.X.X.gem```
|
data/lib/beyonic.rb
CHANGED
data/lib/beyonic/abstract_api.rb
CHANGED
@@ -22,7 +22,9 @@ module Beyonic::AbstractApi
|
|
22
22
|
uri.query_values = payload
|
23
23
|
|
24
24
|
resp = RestClient.get(@endpoint_url + '?' + uri.query, headers)
|
25
|
-
|
25
|
+
ret = self.new(Oj.load(resp))
|
26
|
+
ret.results = ret.results.map { |obj_attrs| self.new(obj_attrs)}
|
27
|
+
return ret
|
26
28
|
end
|
27
29
|
|
28
30
|
def get(id)
|
@@ -48,6 +50,8 @@ module Beyonic::AbstractApi
|
|
48
50
|
headers_hash = {}
|
49
51
|
headers_hash.merge!({"Authorization" => "Token #{Beyonic.api_key}"}) if Beyonic.api_key
|
50
52
|
headers_hash.merge!({"Beyonic-Version" => Beyonic.api_version}) if Beyonic.api_version
|
53
|
+
headers_hash.merge!({"Beyonic-Client" => "Ruby"})
|
54
|
+
headers_hash.merge!({"Beyonic-Client-Version" => Beyonic::VERSION})
|
51
55
|
headers_hash
|
52
56
|
end
|
53
57
|
|
data/lib/beyonic/collection.rb
CHANGED
@@ -2,15 +2,4 @@ require 'ostruct'
|
|
2
2
|
class Beyonic::Collection < OpenStruct
|
3
3
|
include Beyonic::AbstractApi
|
4
4
|
set_endpoint_resource "collections"
|
5
|
-
|
6
|
-
def self.claim(amount, phonenumber, remote_transaction_id)
|
7
|
-
self.list(
|
8
|
-
{
|
9
|
-
claim: true,
|
10
|
-
amount: amount,
|
11
|
-
phonenumber: phonenumber,
|
12
|
-
remote_transaction_id: remote_transaction_id
|
13
|
-
}
|
14
|
-
)
|
15
|
-
end
|
16
5
|
end
|
data/lib/beyonic/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beyonic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg German
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -165,6 +165,7 @@ files:
|
|
165
165
|
- lib/beyonic/abstract_api.rb
|
166
166
|
- lib/beyonic/collection.rb
|
167
167
|
- lib/beyonic/collection_request.rb
|
168
|
+
- lib/beyonic/contact.rb
|
168
169
|
- lib/beyonic/payment.rb
|
169
170
|
- lib/beyonic/version.rb
|
170
171
|
- lib/beyonic/webhook.rb
|
@@ -188,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
189
|
version: '0'
|
189
190
|
requirements: []
|
190
191
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.4.
|
192
|
+
rubygems_version: 2.4.3
|
192
193
|
signing_key:
|
193
194
|
specification_version: 4
|
194
195
|
summary: Ruby library for the beyonic.com api
|