Class: Timestream::Hamster::Fact
- Inherits:
-
Object
- Object
- Timestream::Hamster::Fact
- Defined in:
- lib/timestream/hamster.rb
Instance Attribute Summary collapse
-
#category_name ⇒ Object
readonly
Returns the value of attribute category_name.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#delta_in_seconds ⇒ Object
readonly
Returns the value of attribute delta_in_seconds.
Instance Method Summary collapse
-
#initialize(id, start_timestamp, end_timestamp, description, activity_name, activity_id, category_name, tag_list, date_timestamp, delta_in_seconds) ⇒ Fact
constructor
A new instance of Fact.
Constructor Details
#initialize(id, start_timestamp, end_timestamp, description, activity_name, activity_id, category_name, tag_list, date_timestamp, delta_in_seconds) ⇒ Fact
Returns a new instance of Fact.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/timestream/hamster.rb', line 15 def initialize(id, , , description, activity_name, activity_id, category_name, tag_list, , delta_in_seconds) @id = id # Convert start and end to Times @start_time = Time.at() @end_time = Time.at() @description = description @activity_name = activity_name @activity_id = activity_id @category_name = category_name @tag_list = tag_list # Convert date to a Date date_time = Time.at() date = Date.new(date_time.year, date_time.month, date_time.day) @date = date @delta_in_seconds = delta_in_seconds end |
Instance Attribute Details
#category_name ⇒ Object (readonly)
Returns the value of attribute category_name.
11 12 13 |
# File 'lib/timestream/hamster.rb', line 11 def category_name @category_name end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
12 13 14 |
# File 'lib/timestream/hamster.rb', line 12 def date @date end |
#delta_in_seconds ⇒ Object (readonly)
Returns the value of attribute delta_in_seconds.
13 14 15 |
# File 'lib/timestream/hamster.rb', line 13 def delta_in_seconds @delta_in_seconds end |