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.
527 528 529 |
# File 'lib/kiva.rb', line 527 def countries @countries end |
#default_rate ⇒ Object
Returns the value of attribute default_rate.
525 526 527 |
# File 'lib/kiva.rb', line 525 def default_rate @default_rate end |
#delinquency_rate ⇒ Object
Returns the value of attribute delinquency_rate.
522 523 524 |
# File 'lib/kiva.rb', line 522 def delinquency_rate @delinquency_rate end |
#id ⇒ Object
Returns the value of attribute id.
523 524 525 |
# File 'lib/kiva.rb', line 523 def id @id end |
#image ⇒ Object
Returns the value of attribute image.
528 529 530 |
# File 'lib/kiva.rb', line 528 def image @image end |
#loans_posted ⇒ Object
Returns the value of attribute loans_posted.
526 527 528 |
# File 'lib/kiva.rb', line 526 def loans_posted @loans_posted end |
#name ⇒ Object
Returns the value of attribute name.
521 522 523 |
# File 'lib/kiva.rb', line 521 def name @name end |
#rating ⇒ Object
Returns the value of attribute rating.
519 520 521 |
# File 'lib/kiva.rb', line 519 def @rating end |
#start_date ⇒ Object
Returns the value of attribute start_date.
518 519 520 |
# File 'lib/kiva.rb', line 518 def start_date @start_date end |
#status ⇒ Object
Returns the value of attribute status.
520 521 522 |
# File 'lib/kiva.rb', line 520 def status @status end |
#total_amount_raised ⇒ Object
Returns the value of attribute total_amount_raised.
524 525 526 |
# File 'lib/kiva.rb', line 524 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
547 548 549 550 551 552 553 |
# File 'lib/kiva.rb', line 547 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 |