Class: Overtime::OutOfHoursPresenter
- Inherits:
-
Object
- Object
- Overtime::OutOfHoursPresenter
- Defined in:
- lib/overtime/out_of_hours_presenter.rb
Instance Method Summary collapse
-
#initialize(commit, start, finish) ⇒ OutOfHoursPresenter
constructor
A new instance of OutOfHoursPresenter.
- #to_s ⇒ Object
Constructor Details
#initialize(commit, start, finish) ⇒ OutOfHoursPresenter
Returns a new instance of OutOfHoursPresenter.
4 5 6 7 8 |
# File 'lib/overtime/out_of_hours_presenter.rb', line 4 def initialize(commit, start, finish) @commit = commit @start = start @finish = finish end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/overtime/out_of_hours_presenter.rb', line 10 def to_s if weekend? "This commit -#{@commit.id_abbrev}- by #{@commit.} took place at the weekend" elsif before_start? "This commit -#{@commit.id_abbrev}- by #{@commit.} took place before 9am at #{@commit.}" elsif after_finish? "This commit -#{@commit.id_abbrev}- by #{@commit.} took place after 6pm at #{@commit.}" else "This commit -#{@commit.id_abbrev}- is OK at #{@commit.}" end end |