Class: Devlog::Zezzion
Constant Summary collapse
- COM =
communication session
1
- COD =
coding session
0
Instance Attribute Summary collapse
-
#coding_session_time ⇒ Object
Returns the value of attribute coding_session_time.
-
#com_session_time ⇒ Object
Returns the value of attribute com_session_time.
-
#payed_time ⇒ Object
Returns the value of attribute payed_time.
-
#zzbegin ⇒ Object
Returns the value of attribute zzbegin.
-
#zzbegin_line_number ⇒ Object
Returns the value of attribute zzbegin_line_number.
-
#zzbegin_title ⇒ Object
Returns the value of attribute zzbegin_title.
-
#zzend ⇒ Object
Returns the value of attribute zzend.
-
#zzend_line_number ⇒ Object
Returns the value of attribute zzend_line_number.
-
#zzend_title ⇒ Object
Returns the value of attribute zzend_title.
-
#zztype ⇒ Object
Returns the value of attribute zztype.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#days ⇒ Object
zezzion_time in days.
- #in_hours ⇒ Object
-
#initialize(zztype = COD) ⇒ Zezzion
constructor
A new instance of Zezzion.
-
#per_day ⇒ Object
hours per day.
-
#per_month ⇒ Object
todo.
- #per_week ⇒ Object
-
#session_time ⇒ Object
the whole coding session time.
-
#time ⇒ Object
in seconds.
- #to_s ⇒ Object
- #to_s_in_seconds ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(zztype = COD) ⇒ Zezzion
Returns a new instance of Zezzion.
714 715 716 717 718 719 720 721 722 723 724 725 726 |
# File 'lib/devlog.rb', line 714 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_time ⇒ Object
Returns the value of attribute coding_session_time.
711 712 713 |
# File 'lib/devlog.rb', line 711 def coding_session_time @coding_session_time end |
#com_session_time ⇒ Object
Returns the value of attribute com_session_time.
711 712 713 |
# File 'lib/devlog.rb', line 711 def com_session_time @com_session_time end |
#payed_time ⇒ Object
Returns the value of attribute payed_time.
711 712 713 |
# File 'lib/devlog.rb', line 711 def payed_time @payed_time end |
#zzbegin ⇒ Object
Returns the value of attribute zzbegin.
710 711 712 |
# File 'lib/devlog.rb', line 710 def zzbegin @zzbegin end |
#zzbegin_line_number ⇒ Object
Returns the value of attribute zzbegin_line_number.
712 713 714 |
# File 'lib/devlog.rb', line 712 def zzbegin_line_number @zzbegin_line_number end |
#zzbegin_title ⇒ Object
Returns the value of attribute zzbegin_title.
710 711 712 |
# File 'lib/devlog.rb', line 710 def zzbegin_title @zzbegin_title end |
#zzend ⇒ Object
Returns the value of attribute zzend.
710 711 712 |
# File 'lib/devlog.rb', line 710 def zzend @zzend end |
#zzend_line_number ⇒ Object
Returns the value of attribute zzend_line_number.
712 713 714 |
# File 'lib/devlog.rb', line 712 def zzend_line_number @zzend_line_number end |
#zzend_title ⇒ Object
Returns the value of attribute zzend_title.
710 711 712 |
# File 'lib/devlog.rb', line 710 def zzend_title @zzend_title end |
#zztype ⇒ Object
Returns the value of attribute zztype.
710 711 712 |
# File 'lib/devlog.rb', line 710 def zztype @zztype end |
Instance Method Details
#<=>(other) ⇒ Object
728 729 730 |
# File 'lib/devlog.rb', line 728 def <=>(other) zzbegin <=> other.zzbegin end |
#days ⇒ Object
zezzion_time in days
738 739 740 741 742 743 |
# File 'lib/devlog.rb', line 738 def days min = self.time / 60 hours = min / 60 days = hours / 24 days end |
#in_hours ⇒ Object
774 775 776 |
# File 'lib/devlog.rb', line 774 def in_hours (session_time / 60 / 60).round(3) end |
#per_day ⇒ Object
hours per day
751 752 753 754 |
# File 'lib/devlog.rb', line 751 def per_day # whole time over number of days the parsing covers session_time/days end |
#per_month ⇒ Object
todo
758 759 760 |
# File 'lib/devlog.rb', line 758 def per_month # todo end |
#per_week ⇒ Object
755 756 757 |
# File 'lib/devlog.rb', line 755 def per_week # todo end |
#session_time ⇒ Object
the whole coding session time
746 747 748 |
# File 'lib/devlog.rb', line 746 def session_time @coding_session_time + @com_session_time #in seconds end |
#time ⇒ Object
in seconds
733 734 735 |
# File 'lib/devlog.rb', line 733 def time @zzend.to_time - @zzbegin.to_time end |
#to_s ⇒ Object
766 767 768 |
# File 'lib/devlog.rb', line 766 def to_s "#{(session_time / 60 / 60).round(3)} [h] #{type}, begin on line #{@zzbegin_line_number} at #{@zzbegin}, ends on line #{@zzend_line_number} at #{@zzend}" end |
#to_s_in_seconds ⇒ Object
770 771 772 |
# File 'lib/devlog.rb', line 770 def to_s_in_seconds "#{session_time.round(3)} [s] #{type}, begin on line #{@zzbegin_line_number} at #{@zzbegin}, ends on line #{@zzend_line_number} at #{@zzend}" end |
#type ⇒ Object
762 763 764 |
# File 'lib/devlog.rb', line 762 def type zztype == 0 ? "CodingSession" : "ComSession" end |