Class: Kiva::Partner
- Inherits:
-
Object
- Object
- Kiva::Partner
- Includes:
- Api, DynamicInitializer
- Defined in:
- lib/ruby-kiva/partner.rb
Instance Attribute Summary collapse
-
#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.
-
#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.
-
#status ⇒ Object
Returns the value of attribute status.
-
#total_amount_raised ⇒ Object
Returns the value of attribute total_amount_raised.
Class Method Summary collapse
-
.find(params = {}) ⇒ Object
Find a partner either by :id or all of them Since kiva does not offer search, finding by id is implemented in memory/ruby.
Methods included from DynamicInitializer
Methods included from Api
app_id, app_id=, friendly, friendly=, included
Instance Attribute Details
#default_rate ⇒ Object
Returns the value of attribute default_rate.
5 6 7 |
# File 'lib/ruby-kiva/partner.rb', line 5 def default_rate @default_rate end |
#delinquency_rate ⇒ Object
Returns the value of attribute delinquency_rate.
5 6 7 |
# File 'lib/ruby-kiva/partner.rb', line 5 def delinquency_rate @delinquency_rate end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/ruby-kiva/partner.rb', line 5 def id @id end |
#loans_posted ⇒ Object
Returns the value of attribute loans_posted.
5 6 7 |
# File 'lib/ruby-kiva/partner.rb', line 5 def loans_posted @loans_posted end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/ruby-kiva/partner.rb', line 5 def name @name end |
#rating ⇒ Object
Returns the value of attribute rating.
5 6 7 |
# File 'lib/ruby-kiva/partner.rb', line 5 def @rating end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/ruby-kiva/partner.rb', line 5 def status @status end |
#total_amount_raised ⇒ Object
Returns the value of attribute total_amount_raised.
5 6 7 |
# File 'lib/ruby-kiva/partner.rb', line 5 def total_amount_raised @total_amount_raised end |
Class Method Details
.find(params = {}) ⇒ Object
Find a partner either by :id or all of them Since kiva does not offer search, finding by id is implemented in memory/ruby. Pagination is not supported, page size is 200 and currently there are 143 partners Items are cached but can be reloaded by passing :reload => true (caching is suggested by kiva…)
16 17 18 19 20 21 22 |
# File 'lib/ruby-kiva/partner.rb', line 16 def self.find(params = {}) if params[:id] find().detect() {|item| item.id == params[:id]} else find_all(params) end end |