Class: TempoAPI::Models::Worklog
- Inherits:
-
Object
- Object
- TempoAPI::Models::Worklog
- Defined in:
- lib/tempest_time/api/tempo_api/models/worklog.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#issue ⇒ Object
readonly
Returns the value of attribute issue.
-
#seconds ⇒ Object
readonly
Returns the value of attribute seconds.
Instance Method Summary collapse
- #hours ⇒ Object
-
#initialize(options) ⇒ Worklog
constructor
A new instance of Worklog.
- #minutes ⇒ Object
- #project ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ Worklog
Returns a new instance of Worklog.
6 7 8 9 10 11 |
# File 'lib/tempest_time/api/tempo_api/models/worklog.rb', line 6 def initialize() @id = .fetch(:id) @issue = .fetch(:issue) @seconds = .fetch(:seconds) @description = .fetch(:description) end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/tempest_time/api/tempo_api/models/worklog.rb', line 4 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/tempest_time/api/tempo_api/models/worklog.rb', line 4 def id @id end |
#issue ⇒ Object (readonly)
Returns the value of attribute issue.
4 5 6 |
# File 'lib/tempest_time/api/tempo_api/models/worklog.rb', line 4 def issue @issue end |
#seconds ⇒ Object (readonly)
Returns the value of attribute seconds.
4 5 6 |
# File 'lib/tempest_time/api/tempo_api/models/worklog.rb', line 4 def seconds @seconds end |
Instance Method Details
#hours ⇒ Object
25 26 27 |
# File 'lib/tempest_time/api/tempo_api/models/worklog.rb', line 25 def hours minutes / 60.to_f end |
#minutes ⇒ Object
21 22 23 |
# File 'lib/tempest_time/api/tempo_api/models/worklog.rb', line 21 def minutes seconds / 60.to_f end |
#project ⇒ Object
17 18 19 |
# File 'lib/tempest_time/api/tempo_api/models/worklog.rb', line 17 def project issue.split('-').first end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/tempest_time/api/tempo_api/models/worklog.rb', line 13 def to_s "#{id}: #{issue}: #{time_output}: #{description}" end |