Sha256: e3e97b34893aac4341cf55e6eef325ab29628f19d08edfc1775932acbd12d032

Contents?: true

Size: 537 Bytes

Versions: 15

Compression:

Stored size: 537 Bytes

Contents

require 'active_resource'

module Toggl
  class TimeEntry < ActiveResource::Base
    self.site = 'https://www.toggl.com/api/v8/'
    self.include_root_in_json = true
    self.include_format_in_path = false

    def self.user
      RenuoCliConfig.toggl_api_token
    end

    def self.password
      'api_token'
    end

    def self.current
      data = get(:current)['data']
      data ? new(data) : nil
    end

    def self.start(params)
      post(:start, {}, params.to_json)
    end

    def stop
      put(:stop)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
renuo-cli-3.1.7 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-3.1.6 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-3.1.5 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-3.1.4 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-3.1.3 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-3.1.2 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-3.1.1 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-3.1.0 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-3.0.0 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-2.0.0 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-1.8.0 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-1.7.3 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-1.7.2 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-1.7.1 lib/renuo/cli/app/toggl/time_entry.rb
renuo-cli-1.7.0 lib/renuo/cli/app/toggl/time_entry.rb