Class: Twstats::TwLog
- Inherits:
-
Object
- Object
- Twstats::TwLog
- Defined in:
- lib/twstats/tw_log.rb
Instance Attribute Summary collapse
-
#billable ⇒ Object
readonly
Returns the value of attribute billable.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#decimal_time ⇒ Object
readonly
Returns the value of attribute decimal_time.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#who ⇒ Object
readonly
Returns the value of attribute who.
Instance Method Summary collapse
-
#initialize(row) ⇒ TwLog
constructor
Class use to store the information needed form a given log.
Constructor Details
#initialize(row) ⇒ TwLog
Class use to store the information needed form a given log
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/twstats/tw_log.rb', line 16 def initialize(row) # Receives a row of the CSV file @who = row["Who"] @decimal_time = row["Decimal Hours"].to_f @time = (DateTime.parse(row["End Date/Time"]) - DateTime.parse(row["Date/Time"]))*24 @description = row["Description"] @tags = row["Tags"].split(',') @project = row["Project"] @task = row["Task"] @billable = !row["Is it Billable?"].to_i.zero? @date = DateTime.parse(row['Date']) end |
Instance Attribute Details
#billable ⇒ Object (readonly)
Returns the value of attribute billable.
12 13 14 |
# File 'lib/twstats/tw_log.rb', line 12 def billable @billable end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
8 9 10 |
# File 'lib/twstats/tw_log.rb', line 8 def date @date end |
#decimal_time ⇒ Object (readonly)
Returns the value of attribute decimal_time.
6 7 8 |
# File 'lib/twstats/tw_log.rb', line 6 def decimal_time @decimal_time end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/twstats/tw_log.rb', line 7 def description @description end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
10 11 12 |
# File 'lib/twstats/tw_log.rb', line 10 def project @project end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
9 10 11 |
# File 'lib/twstats/tw_log.rb', line 9 def @tags end |
#task ⇒ Object (readonly)
Returns the value of attribute task.
11 12 13 |
# File 'lib/twstats/tw_log.rb', line 11 def task @task end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
5 6 7 |
# File 'lib/twstats/tw_log.rb', line 5 def time @time end |
#who ⇒ Object (readonly)
Returns the value of attribute who.
4 5 6 |
# File 'lib/twstats/tw_log.rb', line 4 def who @who end |