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

Returns a new instance of 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

Returns:

  • (String)

    specified auction as JSON string.



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

Returns:

  • (String)

    all auctions as JSON string.



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

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

#balanceString

Get account balance details

Returns:

  • (String)

    account balance details as JSON string.



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

Returns:

  • (String)

    bid details as JSON string.



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

Returns:

  • (String)

    bids as JSON string.



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

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

#investmentsString

Get account investments

Returns:

  • (String)

    investments as JSON string.



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

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

#loandatasetString

Get loandatasets

Returns:

  • (String)

    loandatasets as JSON string.



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

Returns:

  • (String)

    loanpart details as JSON string.



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

Returns:

  • (String)

    report details as JSON string.



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

Returns:

  • (String)

    reports as JSON string.



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

Returns:

  • (String)

    all secondary market offers as JSON string.



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

Returns:

  • (String)

    secondary market item details as JSON string.



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

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