Class: Tenk::Users::TimeEntries

Inherits:
UserResource show all
Defined in:
lib/users/time_entries.rb

Overview

API methods for TimeEntries resources for a particular user

Defined Under Namespace

Classes: CreateRequest, GetRequest, ListRequest, UpdateRequest

Instance Method Summary collapse

Methods inherited from UserResource

#delete, #initialize, #resource_root

Constructor Details

This class inherits a constructor from Tenk::Users::UserResource

Instance Method Details

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

Create a new TimeEntry for this user

Parameters:

  • user_id (Integer)

    the id of the user

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

    the post parameters to add to the create request

Returns:

  • (Hashie::Mash)

    the API response as a Hashie::Mash

See Also:



44
45
46
# File 'lib/users/time_entries.rb', line 44

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

#get(user_id, time_entry_id, opts = {}) ⇒ Hashie::Mash

Get a single TimeEntry for this user

Parameters:

  • user_id (Integer)

    the id of the user

  • time_entry_id (Integer)

    the id of the time entry

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

    the query parameters to add to the get request

Returns:

  • (Hashie::Mash)

    the response as a Hashie::Mash

See Also:



35
36
37
# File 'lib/users/time_entries.rb', line 35

def get(user_id, time_entry_id, opts = {})
  super(user_id, time_entry_id, GetRequest.new(opts))
end

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

List TimeEntries for a single user

Parameters:

  • user_id (Integer)

    the id of the user

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

    the query parameters to add to list request

Returns:

  • (Hashie::Mash)

    the API response as a Hashie::Mash

See Also:



25
26
27
# File 'lib/users/time_entries.rb', line 25

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

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

Update an TimeEntry for this user

Parameters:

  • user_id (Integer)

    the id of the user

  • time_entry_id (Integer)

    the id of the time entry

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

    the post parameters to add to the create request

Returns:

  • (Hashie::Mash)

    the API response as a Hashie::Mash

See Also:



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

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