Class: TimeCamp::Task
- Defined in:
- lib/ruby-timecamp/resources/task.rb
Instance Attribute Summary collapse
-
#archived ⇒ Object
readonly
Returns the value of attribute archived.
-
#assigned_by ⇒ Object
readonly
Returns the value of attribute assigned_by.
-
#billable ⇒ Object
readonly
Returns the value of attribute billable.
-
#budget_unit ⇒ Object
readonly
Returns the value of attribute budget_unit.
-
#budgeted ⇒ Object
readonly
Returns the value of attribute budgeted.
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#external_parent_id ⇒ Object
readonly
Returns the value of attribute external_parent_id.
-
#external_task_id ⇒ Object
readonly
Returns the value of attribute external_task_id.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#note ⇒ Object
readonly
Returns the value of attribute note.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
-
#public_hash ⇒ Object
readonly
Returns the value of attribute public_hash.
-
#root_group_id ⇒ Object
readonly
Returns the value of attribute root_group_id.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#task_id ⇒ Object
readonly
Returns the value of attribute task_id.
-
#user_access_type ⇒ Object
readonly
Returns the value of attribute user_access_type.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
Class Method Summary collapse
-
.create(opts = {}) ⇒ Object
required :name optional :tags, :parent_id, :external_task_id, :external_parent_id, :budgeted, :note, :archived, :billable, :budget_unit, :user_ids (comma separated), :role.
-
.get(opts = {}) ⇒ Object
optional :task_id.
-
.update(opts = {}) ⇒ Object
required :task_id optional :name, :tags, :parent_id, :external_task_id, :external_parent_id, :budgeted, :note, :archived, :billable, :budget_unit, :user_ids (comma separated), :role.
Methods inherited from Resource
#attributes, #initialize, resource_name
Constructor Details
This class inherits a constructor from TimeCamp::Resource
Instance Attribute Details
#archived ⇒ Object (readonly)
Returns the value of attribute archived.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def archived @archived end |
#assigned_by ⇒ Object (readonly)
Returns the value of attribute assigned_by.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def assigned_by @assigned_by end |
#billable ⇒ Object (readonly)
Returns the value of attribute billable.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def billable @billable end |
#budget_unit ⇒ Object (readonly)
Returns the value of attribute budget_unit.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def budget_unit @budget_unit end |
#budgeted ⇒ Object (readonly)
Returns the value of attribute budgeted.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def budgeted @budgeted end |
#color ⇒ Object (readonly)
Returns the value of attribute color.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def color @color end |
#external_parent_id ⇒ Object (readonly)
Returns the value of attribute external_parent_id.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def external_parent_id @external_parent_id end |
#external_task_id ⇒ Object (readonly)
Returns the value of attribute external_task_id.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def external_task_id @external_task_id end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def level @level end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def name @name end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def note @note end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def parent_id @parent_id end |
#public_hash ⇒ Object (readonly)
Returns the value of attribute public_hash.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def public_hash @public_hash end |
#root_group_id ⇒ Object (readonly)
Returns the value of attribute root_group_id.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def root_group_id @root_group_id end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def @tags end |
#task_id ⇒ Object (readonly)
Returns the value of attribute task_id.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def task_id @task_id end |
#user_access_type ⇒ Object (readonly)
Returns the value of attribute user_access_type.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def user_access_type @user_access_type end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
3 4 5 |
# File 'lib/ruby-timecamp/resources/task.rb', line 3 def users @users end |
Class Method Details
.create(opts = {}) ⇒ Object
required :name optional :tags, :parent_id, :external_task_id, :external_parent_id,
:budgeted, :note, :archived, :billable, :budget_unit,
:user_ids (comma separated), :role
22 23 24 25 26 27 |
# File 'lib/ruby-timecamp/resources/task.rb', line 22 def self.create(opts={}) data_keys = [:name, :tags, :parent_id, :external_task_id, :external_parent_id, :budgeted, :note, :archived, :billable, :budget_unit, :user_ids, :role] data, opts = opts.partition{ |k, v| data_keys.include?(k) }.map(&:to_h) response = TimeCamp::Request.post(resource_name, opts, data) return TaskCollection.parse(response) end |
.get(opts = {}) ⇒ Object
optional :task_id
13 14 15 16 |
# File 'lib/ruby-timecamp/resources/task.rb', line 13 def self.get(opts={}) response = TimeCamp::Request.get(resource_name, opts) return TaskCollection.parse(response) end |
.update(opts = {}) ⇒ Object
required :task_id optional :name, :tags, :parent_id, :external_task_id,
:external_parent_id, :budgeted, :note, :archived,
:billable, :budget_unit, :user_ids (comma separated), :role
33 34 35 36 37 38 |
# File 'lib/ruby-timecamp/resources/task.rb', line 33 def self.update(opts={}) data_keys = [:task_id, :name, :tags, :parent_id, :external_task_id, :external_parent_id, :budgeted, :note, :archived, :billable, :budget_unit, :user_ids, :role] data, opts = opts.partition{ |k, v| data_keys.include?(k) }.map(&:to_h) response = TimeCamp::Request.put(resource_name, opts, data) return TaskCollection.parse(response) end |