Class: Devlog::Zezzion

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

Constant Summary collapse

COM =

communication session

1
COD =

coding session

0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(zztype = COD) ⇒ Zezzion



454
455
456
457
458
459
460
461
462
463
464
465
466
# File 'lib/devlog.rb', line 454

def initialize(zztype=COD)
  @zztype = zztype
  @zzbegin = nil
  @zzend = nil
  @zzbegin = nil
  @zzbegin_title = nil
  @zzend_title = nil
  @coding_session_time = 0.0
  @com_session_time = 0.0
  @payed_time = 0.0
  @zzbegin_line_number = 0
  @zzend_line_number = 0
end

Instance Attribute Details

#coding_session_timeObject

Returns the value of attribute coding_session_time.



451
452
453
# File 'lib/devlog.rb', line 451

def coding_session_time
  @coding_session_time
end

#com_session_timeObject

Returns the value of attribute com_session_time.



451
452
453
# File 'lib/devlog.rb', line 451

def com_session_time
  @com_session_time
end

#payed_timeObject

Returns the value of attribute payed_time.



451
452
453
# File 'lib/devlog.rb', line 451

def payed_time
  @payed_time
end

#zzbeginObject

Returns the value of attribute zzbegin.



450
451
452
# File 'lib/devlog.rb', line 450

def zzbegin
  @zzbegin
end

#zzbegin_line_numberObject

Returns the value of attribute zzbegin_line_number.



452
453
454
# File 'lib/devlog.rb', line 452

def zzbegin_line_number
  @zzbegin_line_number
end

#zzbegin_titleObject

Returns the value of attribute zzbegin_title.



450
451
452
# File 'lib/devlog.rb', line 450

def zzbegin_title
  @zzbegin_title
end

#zzendObject

Returns the value of attribute zzend.



450
451
452
# File 'lib/devlog.rb', line 450

def zzend
  @zzend
end

#zzend_line_numberObject

Returns the value of attribute zzend_line_number.



452
453
454
# File 'lib/devlog.rb', line 452

def zzend_line_number
  @zzend_line_number
end

#zzend_titleObject

Returns the value of attribute zzend_title.



450
451
452
# File 'lib/devlog.rb', line 450

def zzend_title
  @zzend_title
end

#zztypeObject

Returns the value of attribute zztype.



450
451
452
# File 'lib/devlog.rb', line 450

def zztype
  @zztype
end

Instance Method Details

#daysObject

zezzion_time in days



474
475
476
477
478
# File 'lib/devlog.rb', line 474

def days
  min = self.time / 60
  hours = min / 60
  days = hours / 24
end

#per_dayObject

hours per day



486
487
488
489
# File 'lib/devlog.rb', line 486

def per_day
  #whole time over number of days the parsing covers      
  session_time/days
end

#per_monthObject

todo



493
494
495
# File 'lib/devlog.rb', line 493

def per_month
  #todo
end

#per_weekObject



490
491
492
# File 'lib/devlog.rb', line 490

def per_week
  #todo
end

#session_timeObject

the whole coding session time



481
482
483
# File 'lib/devlog.rb', line 481

def session_time
  @coding_session_time + @com_session_time #in seconds
end

#timeObject

in seconds



469
470
471
# File 'lib/devlog.rb', line 469

def time
  @zzend.to_time -  @zzbegin.to_time
end

#to_sObject



501
502
503
# File 'lib/devlog.rb', line 501

def to_s
  "#{session_time.round(3)} [h] #{type}, begin on line #{@zzbegin_line_number} at #{@zzbegin}, ends on line #{@zzend_line_number} at #{@zzend}"
end

#typeObject



497
498
499
# File 'lib/devlog.rb', line 497

def type
  zztype == 0 ? "CodingSession" : "ComSession"
end