module Frecli::Queries::ClassMethods

Public Instance Methods

api() click to toggle source
# File lib/frecli/queries.rb, line 8
def api
  @api = FreckleApi.new(Settings[:api_key])
end
project(id) click to toggle source
# File lib/frecli/queries.rb, line 16
def project(id)
  api.project(id)
end
projects() click to toggle source
# File lib/frecli/queries.rb, line 12
def projects
  api.projects
end
timer(project_id = nil) click to toggle source
# File lib/frecli/queries.rb, line 28
def timer(project_id = nil)
  api.timer(project_id) || timer_current
end
timer_current() click to toggle source
# File lib/frecli/queries.rb, line 32
def timer_current
  timers.detect { |timer| timer.state == :running }
end
timer_log(timer, description = nil) click to toggle source
# File lib/frecli/queries.rb, line 24
def timer_log(timer, description = nil)
  timer.log!(api, description: description)
end
timer_pause(timer) click to toggle source
# File lib/frecli/queries.rb, line 42
def timer_pause(timer)
  timer.pause!(api)
end
timer_start(project) click to toggle source
# File lib/frecli/queries.rb, line 36
def timer_start(project)
  FreckleApi::Timer.new(project: project).tap do |timer|
    timer.start!(api)
  end
end
timers() click to toggle source
# File lib/frecli/queries.rb, line 20
def timers
  api.timers
end