Class: Bondora::API

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/bondora/api.rb

Instance Method Summary collapse

Constructor Details

#initialize(auth_code) ⇒ API



6
7
8
# File 'lib/bondora/api.rb', line 6

def initialize(auth_code)
  self.class.headers 'Authorization' => "Bearer #{auth_code}"
end

Instance Method Details

#auction(auction_id) ⇒ String

Get auction for specified auction



21
22
23
# File 'lib/bondora/api.rb', line 21

def auction(auction_id)
  self.class.get("/auction/#{auction_id}").to_json
end

#auctionsString

Get all auctions



14
15
16
# File 'lib/bondora/api.rb', line 14

def auctions
  self.class.get('/auctions').to_json
end

#balanceString

Get account balance details



49
50
51
# File 'lib/bondora/api.rb', line 49

def balance
  self.class.get('/account/balance').to_json
end

#bid(bid_id) ⇒ String

Get bid details



88
89
90
# File 'lib/bondora/api.rb', line 88

def bid(bid_id)
  self.class.get("/bid/#{bid_id}").to_json
end

#bidsString

Get bids



81
82
83
# File 'lib/bondora/api.rb', line 81

def bids
  self.class.get('/bids').to_json
end

#investmentsString

Get account investments



56
57
58
# File 'lib/bondora/api.rb', line 56

def investments
  self.class.get('/account/investments').to_json
end

#loandatasetString

Get loandatasets



95
96
97
# File 'lib/bondora/api.rb', line 95

def loandataset
  self.class.get('/loandataset').to_json
end

#loanpart(loanpart_id) ⇒ String

Get loanpart details



42
43
44
# File 'lib/bondora/api.rb', line 42

def loanpart(loanpart_id)
  self.class.get("/loanpart/#{loanpart_id}").to_json
end

#report(report_id) ⇒ String

Get report details



109
110
111
# File 'lib/bondora/api.rb', line 109

def report(report_id)
  self.class.get("/report/#{report_id}").to_json
end

#reportsString

Get reports



102
103
104
# File 'lib/bondora/api.rb', line 102

def reports
  self.class.get('/reports').to_json
end

#secondarymarketString

Get all secondary market offers



28
29
30
# File 'lib/bondora/api.rb', line 28

def secondarymarket
  self.class.get('/secondarymarket').to_json
end

#secondarymarket_item(item_id) ⇒ String

Get secondary market item details



35
36
37
# File 'lib/bondora/api.rb', line 35

def secondarymarket_item(item_id)
  self.class.get("/secondarymarket/#{item_id}").to_json
end