Class: Kiva::Team
- Inherits:
-
Object
- Object
- Kiva::Team
- Includes:
- Api, DynamicInitializer
- Defined in:
- lib/ruby-kiva/team.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#image ⇒ Object
Returns the value of attribute image.
-
#loan_because ⇒ Object
Returns the value of attribute loan_because.
-
#loan_count ⇒ Object
Returns the value of attribute loan_count.
-
#loaned_amount ⇒ Object
Returns the value of attribute loaned_amount.
-
#member_count ⇒ Object
Returns the value of attribute member_count.
-
#membership_type ⇒ Object
Returns the value of attribute membership_type.
-
#name ⇒ Object
Returns the value of attribute name.
-
#shortname ⇒ Object
Returns the value of attribute shortname.
-
#website_url ⇒ Object
Returns the value of attribute website_url.
-
#whereabouts ⇒ Object
Returns the value of attribute whereabouts.
Class Method Summary collapse
-
.find(params) ⇒ Object
find a team by :id or :shortname.
Instance Method Summary collapse
Methods included from Api
app_id, app_id=, friendly, friendly=, included
Methods included from DynamicInitializer
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def category @category end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def id @id end |
#image ⇒ Object
Returns the value of attribute image.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def image @image end |
#loan_because ⇒ Object
Returns the value of attribute loan_because.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def loan_because @loan_because end |
#loan_count ⇒ Object
Returns the value of attribute loan_count.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def loan_count @loan_count end |
#loaned_amount ⇒ Object
Returns the value of attribute loaned_amount.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def loaned_amount @loaned_amount end |
#member_count ⇒ Object
Returns the value of attribute member_count.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def member_count @member_count end |
#membership_type ⇒ Object
Returns the value of attribute membership_type.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def membership_type @membership_type end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def name @name end |
#shortname ⇒ Object
Returns the value of attribute shortname.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def shortname @shortname end |
#website_url ⇒ Object
Returns the value of attribute website_url.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def website_url @website_url end |
#whereabouts ⇒ Object
Returns the value of attribute whereabouts.
7 8 9 |
# File 'lib/ruby-kiva/team.rb', line 7 def whereabouts @whereabouts end |
Class Method Details
.find(params) ⇒ Object
find a team by :id or :shortname
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ruby-kiva/team.rb', line 21 def self.find(params) if params[:id] data = get("/teams/#{sanitize_id_parameter(params[:id])}.json", :query => (params)) many = sanitize_id_parameter(params[:id]).include?(',') elsif params[:shortname] data = get("/teams/using_shortname/#{sanitize_id_parameter(params[:shortname])}.json", :query => (params)) many = sanitize_id_parameter(params[:shortnames]).include?(',') else data = get("/teams/search.json", :query => (params)) many = true end json_to_paged_array(data, 'teams', many) end |