Class: Tenk::TimeEntries

Inherits:
Resource show all
Defined in:
lib/time_entries.rb

Overview

API methods for TimeEntries resources, which represent time that users are tracking against projects or phases

Defined Under Namespace

Classes: CreateRequest, GetRequest, ListRequest, UpdateRequest

Instance Method Summary collapse

Methods inherited from Resource

#initialize, #resource_root

Constructor Details

This class inherits a constructor from Tenk::Resource

Instance Method Details

#create(opts = {}) ⇒ Hashie::Mash

Create a TimeEntry for this account

Parameters:

  • opts (Hash) (defaults to: {})

    the attributes of the TimeEntry to create

Returns:

  • (Hashie::Mash)

    the API response as a Hashie::Mash

See Also:



54
55
56
# File 'lib/time_entries.rb', line 54

def create(opts = {})
  super(CreateRequest.new(opts))
end

#get(id) ⇒ Hashie::Mash

Get a single TimeEntry for an account

Parameters:

  • id (Integer)

    the id of the TimeEntry

Returns:

  • (Hashie::Mash)

    the API response as a Hashie::Mash



46
47
48
# File 'lib/time_entries.rb', line 46

def get(id)
  super(id, {})
end

#list(opts = {}) ⇒ Hashie::Mash

List TimeEntries for an account

Parameters:

  • opts (Hash) (defaults to: {})

    the filter parameters for the list

Returns:

  • (Hashie::Mash)

    the API response as a Hashie::Mash

See Also:



39
40
41
# File 'lib/time_entries.rb', line 39

def list(opts = {})
  super(ListRequest.new(opts))
end

#update(id, opts = {}) ⇒ Hashie::Mash

Update a TimeEntry for this account

Parameters:

  • id (Integer)

    the id of the TimeEntry

  • opts (Hash) (defaults to: {})

    the attributes of the TimeEntry to update

Returns:

  • (Hashie::Mash)

    the API response as a Hashie::Mash

See Also:



63
64
65
# File 'lib/time_entries.rb', line 63

def update(id, opts = {})
  super(id, UpdateRequest.new(opts))
end