Class: Kiva::JournalEntry

Inherits:
Object
  • Object
show all
Includes:
Api, DynamicInitializer
Defined in:
lib/ruby-kiva/journal_entry.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Api

app_id, app_id=, friendly, friendly=, included

Methods included from DynamicInitializer

included

Instance Attribute Details

#authorObject

Returns the value of attribute author.



5
6
7
# File 'lib/ruby-kiva/journal_entry.rb', line 5

def author
  @author
end

#bodyObject

Returns the value of attribute body.



5
6
7
# File 'lib/ruby-kiva/journal_entry.rb', line 5

def body
  @body
end

#bulkObject

Returns the value of attribute bulk.



5
6
7
# File 'lib/ruby-kiva/journal_entry.rb', line 5

def bulk
  @bulk
end

#comment_countObject

Returns the value of attribute comment_count.



5
6
7
# File 'lib/ruby-kiva/journal_entry.rb', line 5

def comment_count
  @comment_count
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/ruby-kiva/journal_entry.rb', line 5

def id
  @id
end

#recommendation_countObject

Returns the value of attribute recommendation_count.



5
6
7
# File 'lib/ruby-kiva/journal_entry.rb', line 5

def recommendation_count
  @recommendation_count
end

#subjectObject

Returns the value of attribute subject.



5
6
7
# File 'lib/ruby-kiva/journal_entry.rb', line 5

def subject
  @subject
end

Class Method Details

.find(params) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/ruby-kiva/journal_entry.rb', line 15

def self.find(params)
  if params[:loan_id]
    json_to_paged_array(get("/loans/#{params[:loan_id]}/journal_entries.json",
      :query => sanitize_options(params)), 'journal_entries', true)
  else
    json_to_paged_array(get("/journal_entries/search.json",
      :query => sanitize_options(params)), 'journal_entries', true)
  end
end

Instance Method Details

#bulk?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/ruby-kiva/journal_entry.rb', line 11

def bulk?
  self.bulk
end

#comments(params = {}) ⇒ Object



25
26
27
# File 'lib/ruby-kiva/journal_entry.rb', line 25

def comments(params = {})
  @comments ||= Comment.find(params.merge({:journal_entry_id => self.id}))
end