Module: Kiva::Api

Included in:
Comment, JournalEntry, Lender, LendingAction, Loan, Partner, Team
Defined in:
lib/ruby-kiva/api.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.app_idObject

retrieve the API id



8
9
10
# File 'lib/ruby-kiva/api.rb', line 8

def self.app_id
  @@app_id if defined? @@app_id
end

.app_id=(value) ⇒ Object

set the API id



4
5
6
# File 'lib/ruby-kiva/api.rb', line 4

def self.app_id=(value)
  @@app_id = value
end

.friendlyObject



15
16
17
# File 'lib/ruby-kiva/api.rb', line 15

def self.friendly
  @@friendly if defined? @@friendly
end

.friendly=(value) ⇒ Object



12
13
14
# File 'lib/ruby-kiva/api.rb', line 12

def self.friendly=(value)
  @@friendly = value
end

.included(receiver) ⇒ Object



84
85
86
87
88
89
90
# File 'lib/ruby-kiva/api.rb', line 84

def self.included(receiver)
  receiver.instance_eval do
    extend ClassMethods
    include HTTParty
    base_uri 'http://api.kivaws.org/v1'
  end
end