Class: Kiva::Partner
- Inherits:
-
Object
- Object
- Kiva::Partner
- Defined in:
- lib/kiva.rb
Overview
Kiva field Partner
Constant Summary collapse
- KEY =
"partners"
- LOAD =
"http://api.kivaws.org/v1/partners.json?"
Instance Attribute Summary collapse
-
#countries ⇒ Object
Returns the value of attribute countries.
-
#default_rate ⇒ Object
Returns the value of attribute default_rate.
-
#delinquency_rate ⇒ Object
Returns the value of attribute delinquency_rate.
-
#id ⇒ Object
Returns the value of attribute id.
-
#image ⇒ Object
Returns the value of attribute image.
-
#loans_posted ⇒ Object
Returns the value of attribute loans_posted.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#status ⇒ Object
Returns the value of attribute status.
-
#total_amount_raised ⇒ Object
Returns the value of attribute total_amount_raised.
Class Method Summary collapse
-
.load(page = nil) ⇒ Object
Load an alphabetically sorted list of partners.
Instance Attribute Details
#countries ⇒ Object
Returns the value of attribute countries.
493 494 495 |
# File 'lib/kiva.rb', line 493 def countries @countries end |
#default_rate ⇒ Object
Returns the value of attribute default_rate.
491 492 493 |
# File 'lib/kiva.rb', line 491 def default_rate @default_rate end |
#delinquency_rate ⇒ Object
Returns the value of attribute delinquency_rate.
488 489 490 |
# File 'lib/kiva.rb', line 488 def delinquency_rate @delinquency_rate end |
#id ⇒ Object
Returns the value of attribute id.
489 490 491 |
# File 'lib/kiva.rb', line 489 def id @id end |
#image ⇒ Object
Returns the value of attribute image.
494 495 496 |
# File 'lib/kiva.rb', line 494 def image @image end |
#loans_posted ⇒ Object
Returns the value of attribute loans_posted.
492 493 494 |
# File 'lib/kiva.rb', line 492 def loans_posted @loans_posted end |
#name ⇒ Object
Returns the value of attribute name.
487 488 489 |
# File 'lib/kiva.rb', line 487 def name @name end |
#rating ⇒ Object
Returns the value of attribute rating.
485 486 487 |
# File 'lib/kiva.rb', line 485 def @rating end |
#start_date ⇒ Object
Returns the value of attribute start_date.
484 485 486 |
# File 'lib/kiva.rb', line 484 def start_date @start_date end |
#status ⇒ Object
Returns the value of attribute status.
486 487 488 |
# File 'lib/kiva.rb', line 486 def status @status end |
#total_amount_raised ⇒ Object
Returns the value of attribute total_amount_raised.
490 491 492 |
# File 'lib/kiva.rb', line 490 def total_amount_raised @total_amount_raised end |
Class Method Details
.load(page = nil) ⇒ Object
Load an alphabetically sorted list of partners.
Parameters
page
: page position
Returns
an array of Partner
instances
Corresponds
513 514 515 516 517 518 519 |
# File 'lib/kiva.rb', line 513 def load page=nil url = page ? LOAD + "page=#{page}" : LOAD raw = raw = Kiva.execute(url) unw = JSON.parse(raw) Kiva._populate self, unw[KEY] end |