Class: Freckly::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/freckly/entry.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry_hashie) ⇒ Entry

Returns a new instance of Entry.



15
16
17
# File 'lib/freckly/entry.rb', line 15

def initialize(entry_hashie)
  @entry_hashie = entry_hashie
end

Class Method Details

.all(options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/freckly/entry.rb', line 4

def all(options={})
  results = Freckly.authed_get("/api/entries.xml", :search => options)

  if entries = results[:entries]
    entries.map {|entry| new(entry) }
  else
    []
  end
end