bondora 0.1.0 → 0.2.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: 8eafedaec58c0c820be6b99f0d282f937d49affd
4
- data.tar.gz: afdaf58a680c62c8f061f813018bf907a1941319
3
+ metadata.gz: 598c405b0afd24e3e4ee05faff6d613bf92efd5c
4
+ data.tar.gz: 99e25a29f7c561ac3af77577fddbf28eaf190642
5
5
  SHA512:
6
- metadata.gz: dc3277f8a6b3be5fca3457cbb4cb630a1fe2999385800b1ab7a4f68e525bdb9c4f073b8a5f119605a717bf9f966b4bda0e14b64a1171cad07b0952fc7f883b89
7
- data.tar.gz: 16dd0278a86128c5a7ce852940e10e485448bd579e3604df0e562b1ad27a561792be16e352b82d6ede05cfa92df55f5dce18d7a180eb324d0224e65140da01b4
6
+ metadata.gz: ca9672b2d92aca51e89f1613d51e669a25f995413dcea2bb3f72b69db6c3797ab6cc78d36b174ca4616f45099856dcfd367b8ee2a374a37c38b2c3e5a143b0a0
7
+ data.tar.gz: 8bdaac6335f38f82dd9359dcd214067a6f897f9d2eefdea57194db73762948572aec270bcbdd739a3b72ae1a1e35ccf1f2e73b7628f96e9a47afc030987ff5cb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bondora (0.1.0)
4
+ bondora (0.2.0)
5
5
  httparty (~> 0.13.0)
6
6
  json (~> 1.8, >= 1.8.0)
7
7
 
data/README.md CHANGED
@@ -23,11 +23,13 @@ Or install it yourself as:
23
23
  The OAuth authorization flow is not implemented. To use the module you need to have an authorization code for your application from Bondora.
24
24
  Contributions to make this right are welcome.
25
25
 
26
+ It is also recommended to use Bondoras sandbox API. To do so, always create the object with `true as second argument.
27
+
26
28
  ## Usage
27
29
 
28
30
  ```ruby
29
- # create new client
30
- client = Bondora::API.new('AUTHORIZATION_CODE')
31
+ # create new client (sandbox mode)
32
+ client = Bondora::API.new('AUTHORIZATION_CODE', true)
31
33
 
32
34
  # get list of investments
33
35
  client.investments
@@ -42,6 +44,8 @@ client.auctions
42
44
  client.auction(AUCTION_ID)
43
45
  ```
44
46
 
47
+ See the [Documentation](http://www.rubydoc.info/gems/bondora/0.1.0) for further intel.
48
+
45
49
  ## Development
46
50
 
47
51
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/lib/bondora/api.rb CHANGED
@@ -1,10 +1,20 @@
1
1
  module Bondora
2
2
  class API
3
3
  include HTTParty
4
- base_uri 'https://api.bondora.com/api/v1'
5
4
 
6
- def initialize(auth_code)
5
+ # Create new API client
6
+ #
7
+ # @param auth_code [String] authorization code
8
+ # @param sandbox [Bool] mode switch
9
+ # @return [Object] Bondora::API object
10
+ def initialize(auth_code, *sandbox)
7
11
  self.class.headers 'Authorization' => "Bearer #{auth_code}"
12
+
13
+ if sandbox
14
+ self.class.base_uri 'https://api-sandbox.bondora.com/api/v1'
15
+ else
16
+ self.class.base_uri 'https://api.bondora.com/api/v1'
17
+ end
8
18
  end
9
19
 
10
20
 
@@ -17,6 +27,7 @@ module Bondora
17
27
 
18
28
  # Get auction for specified auction
19
29
  #
30
+ # @param auction_id [String] auction id
20
31
  # @return [String] specified auction as JSON string.
21
32
  def auction(auction_id)
22
33
  self.class.get("/auction/#{auction_id}").to_json
@@ -31,6 +42,7 @@ module Bondora
31
42
 
32
43
  # Get secondary market item details
33
44
  #
45
+ # @param item_id [String] secondary market item id
34
46
  # @return [String] secondary market item details as JSON string.
35
47
  def secondarymarket_item(item_id)
36
48
  self.class.get("/secondarymarket/#{item_id}").to_json
@@ -38,6 +50,7 @@ module Bondora
38
50
 
39
51
  # Get loanpart details
40
52
  #
53
+ # @param loanpart_id [String] loanpart id
41
54
  # @return [String] loanpart details as JSON string.
42
55
  def loanpart(loanpart_id)
43
56
  self.class.get("/loanpart/#{loanpart_id}").to_json
@@ -84,6 +97,7 @@ module Bondora
84
97
 
85
98
  # Get bid details
86
99
  #
100
+ # @param bid_id [String] bid id
87
101
  # @return [String] bid details as JSON string.
88
102
  def bid(bid_id)
89
103
  self.class.get("/bid/#{bid_id}").to_json
@@ -105,6 +119,7 @@ module Bondora
105
119
 
106
120
  # Get report details
107
121
  #
122
+ # @param report_id [String] report id
108
123
  # @return [String] report details as JSON string.
109
124
  def report(report_id)
110
125
  self.class.get("/report/#{report_id}").to_json
@@ -1,3 +1,3 @@
1
1
  module Bondora
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bondora
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Schritt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-20 00:00:00.000000000 Z
11
+ date: 2016-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty