Class: Task

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

Class Method Summary collapse

Class Method Details

.find(id) ⇒ Object



7
8
9
10
11
# File 'lib/freshbookstimestats.rb', line 7

def self.find(id)
  memoize :task, id do
    FreshBooks::Task.get id
  end
end

.memoize(*keys) ⇒ Object



13
14
15
16
# File 'lib/freshbookstimestats.rb', line 13

def self.memoize(*keys)
  @_cache ||= {}
  @_cache[keys.join('-')] ||= yield
end