Motion-Tickspot

Build Status Code Climate

A RubyMotion wrapper for Tick's API that works on iOS and OS X.

Installation

Add this line to your application's Gemfile:

gem "motion-tickspot"

And then execute:

$ bundle

Or install it yourself as:

$ gem install motion-tickspot

Usage

Authentication

Authentication is handled by Tick::Session with some convenience methods.

SSKeychain is being used to save the user's password to the iOS or OS X keychain.

Tick.logged_in? # true/false

Tick.("company/subdomain", "[email protected]", "password") do |session|
  if session
    # Success!
  else
    # Failed to log in
  end
end

Tick.log_out

Tick::Client

Tick::Client.list do |clients|
  # Returns array of Tick::Clients
  # Raises Tick::AuthenticationError if not logged in
end

Tick::Entry

Tick::Entry.create({
  task_id: 1,
  hours: 2.5,
  date: "2008-03-17",
  notes: "She can't take much more of this Captain"
}) do |entry|
  # Returns the saved Tick::Entry
  # Raises Tick::AuthenticationError if not logged in
end
Tick::Entry.list do |entries|
  # Returns array of Tick::Entries
  # Raises Tick::AuthenticationError if not logged in
end

Tick::Project

Tick::Project.list do |projects|
  # Returns array of Tick::Projects
  # Raises Tick::AuthenticationError if not logged in
end

Tick::Session

Tick::Session.current
# Returns Tick::Session instance or nil

Tick::Task

Tick::Task.list do |tasks|
  # Returns array of Tick::Tasks
  # Raises Tick::AuthenticationError if not logged in
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request