Class: Kiva::LendingAction
- Inherits:
-
Object
- Object
- Kiva::LendingAction
- Defined in:
- lib/kiva.rb
Overview
LendingAction
are basically a showcase of recent Kiva activity. Use the class method load
to loan the last 100 lenders and the loan they sponsored.
Constant Summary collapse
- KEY =
"lending_actions"
- LOAD_RECENT =
"http://api.kivaws.org/v1/lending_actions/recent.json"
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lender ⇒ Object
Returns the value of attribute lender.
-
#loan ⇒ Object
Returns the value of attribute loan.
Class Method Summary collapse
-
.load ⇒ Object
Returns the last 100 public actions from Kiva.
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
353 354 355 |
# File 'lib/kiva.rb', line 353 def date @date end |
#id ⇒ Object
Returns the value of attribute id.
352 353 354 |
# File 'lib/kiva.rb', line 352 def id @id end |
#lender ⇒ Object
Returns the value of attribute lender.
354 355 356 |
# File 'lib/kiva.rb', line 354 def lender @lender end |
#loan ⇒ Object
Returns the value of attribute loan.
355 356 357 |
# File 'lib/kiva.rb', line 355 def loan @loan end |
Class Method Details
.load ⇒ Object
Returns the last 100 public actions from Kiva.
Returns
an array of LendingAction
instances
corresponds
371 372 373 374 375 376 377 |
# File 'lib/kiva.rb', line 371 def load raw = Kiva.execute(LOAD_RECENT) unw = JSON.parse(raw) Kiva._populate LendingAction, unw[KEY] end |