Class SlimTimer
In: lib/slimtimer4r.rb
Parent: Object

Methods

Classes and Modules

Class SlimTimer::Record

Constants

VERSION = '0.2.1'

Attributes

access_token  [RW] 
api_key  [RW] 
email  [RW] 
password  [RW] 
request  [RW] 
user_id  [RW] 

Public Class methods

Creates a new SlimTimer object and obtains the access_token and user_id from the SlimTimer API by sending your email, password, and api_key. Raises a RuntimeError if it can‘t authenticate.

  slim_timer = SlimTimer.new("person@example.com", "password", "12345")
    => #<SlimTimer:0x68bca8 @password="password"...>

  slim_timer = SlimTimer.new("bademail@example.com", "badpassword", "12345")
    => RuntimeError: Error occurred (500)

Public Instance methods

Returns an array of Record objects, each representing a task. Returns an empty array if nothing is found.

Options:

show_completed:Include completed tasks. Specify only to only include the completed tasks. Valid options are yes, no, and only. Default is yes.
role:Include tasks where the user‘s role is one of the roles given (comma delimited). Valid options include owner, coworker, and reporter. Default is +owner,coworker+.

Returns an array of Record objects, each representing a time entry. Returns an empty array if nothing is found.

Options:

range_start:Only include entries after this time. Takes either a Date or Time object as a parameter. If a Date object is used, it will append a time of 00:00:00 to the request. Default is nil, meaning there is no start range.
range_end :Only include entries before this time. Takes either a Date or Time object as a parameter. If a Date object is used, it will append a time of 23:59:59 to the request. Default is nil, meaning there is no end range.

Returns a specific task as a Record object. Returns nil if the record is not found.

Options:

task_id:The id of the task you would like to retrieve.

[Validate]