Class: ActiveCollab::TimeRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/active_collab/time_record.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#billable_statusObject

Returns the value of attribute billable_status.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def billable_status
  @billable_status
end

#created_byObject

Returns the value of attribute created_by.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def created_by
  @created_by
end

#created_onObject

Returns the value of attribute created_on.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def created_on
  @created_on
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def id
  @id
end

#job_type_idObject

Returns the value of attribute job_type_id.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def job_type_id
  @job_type_id
end

#parent_classObject

Returns the value of attribute parent_class.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def parent_class
  @parent_class
end

#parent_idObject

Returns the value of attribute parent_id.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def parent_id
  @parent_id
end

Returns the value of attribute permalink.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def permalink
  @permalink
end

#permissionsObject

Returns the value of attribute permissions.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def permissions
  @permissions
end

#project_idObject

Returns the value of attribute project_id.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def project_id
  @project_id
end

#record_dateObject

Returns the value of attribute record_date.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def record_date
  @record_date
end

#stateObject

Returns the value of attribute state.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def state
  @state
end

#summaryObject

Returns the value of attribute summary.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def summary
  @summary
end

#urlsObject

Returns the value of attribute urls.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def urls
  @urls
end

#user_idObject

Returns the value of attribute user_id.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def user_id
  @user_id
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/active_collab/time_record.rb', line 3

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/active_collab/time_record.rb', line 7

def self.from_hash(hash)
	time_record = ActiveCollab::TimeRecord.new
	time_record.id = hash["id"].to_i
	time_record.permalink = hash["permalink"]
	time_record.urls = hash["urls"]
	time_record.permissions = hash["permissions"]
	time_record.created_on = hash["created_on"]
	time_record.created_by = hash["created_by"]
	time_record.parent_class = hash["parent_class"]
	time_record.parent_id = hash["parent_id"].to_i
	time_record.state = hash["state"].to_i
	time_record.project_id = hash["project"]["id"].to_i
	time_record.billable_status = hash["billable_status"].to_i
	time_record.value = hash["value"].to_f
	time_record.record_date = hash["record_date"]
	time_record.summary = hash["summary"]
	time_record.user_id = hash["user"]["id"]
	time_record.job_type_id = hash["job_type"]["id"]
end