Class: Paymo::Entry
- Inherits:
-
Object
- Object
- Paymo::Entry
- Defined in:
- lib/paymo/models/entry.rb
Instance Attribute Summary collapse
-
#added_manually ⇒ Object
Returns the value of attribute added_manually.
-
#billed ⇒ Object
Returns the value of attribute billed.
-
#description ⇒ Object
Returns the value of attribute description.
-
#end ⇒ Object
Returns the value of attribute end.
-
#id ⇒ Object
Returns the value of attribute id.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
-
#start ⇒ Object
Returns the value of attribute start.
-
#task_id ⇒ Object
Returns the value of attribute task_id.
-
#task_name ⇒ Object
Returns the value of attribute task_name.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
Instance Method Summary collapse
-
#initialize(result) ⇒ Entry
constructor
A new instance of Entry.
Constructor Details
#initialize(result) ⇒ Entry
Returns a new instance of Entry.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/paymo/models/entry.rb', line 7 def initialize(result) @id = result['id'].to_i @added_manually = !!result['added_manually'] @billed = !!result['billed'] @start = DateTime.parse(result['start']['_content']) @end = DateTime.parse(result['end']['_content']) @description = result['description']['_content'] @user_id = result['user']['id'].to_i @user_name = result['user']['name'] @task_id = result['task']['id'].to_i @task_name = result['task']['name'] @project_id = result['project']['id'].to_i @project_name = result['project']['name'] end |
Instance Attribute Details
#added_manually ⇒ Object
Returns the value of attribute added_manually.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def added_manually @added_manually end |
#billed ⇒ Object
Returns the value of attribute billed.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def billed @billed end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def description @description end |
#end ⇒ Object
Returns the value of attribute end.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def end @end end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def id @id end |
#project_id ⇒ Object
Returns the value of attribute project_id.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def project_id @project_id end |
#project_name ⇒ Object
Returns the value of attribute project_name.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def project_name @project_name end |
#start ⇒ Object
Returns the value of attribute start.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def start @start end |
#task_id ⇒ Object
Returns the value of attribute task_id.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def task_id @task_id end |
#task_name ⇒ Object
Returns the value of attribute task_name.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def task_name @task_name end |
#user_id ⇒ Object
Returns the value of attribute user_id.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def user_id @user_id end |
#user_name ⇒ Object
Returns the value of attribute user_name.
4 5 6 |
# File 'lib/paymo/models/entry.rb', line 4 def user_name @user_name end |