Class: Roxbury::EmptyWorkingHours

Inherits:
WorkingHours show all
Defined in:
lib/roxbury/empty_working_hours.rb

Overview

Null object version of WorkingHours for holidays and other non working days

Instance Attribute Summary

Attributes inherited from WorkingHours

#begins_at, #ends_at

Instance Method Summary collapse

Methods inherited from WorkingHours

#at_beginning, #at_end, parse, #quantity, #working_day?

Constructor Details

#initializeEmptyWorkingHours

Returns a new instance of EmptyWorkingHours.



4
5
6
# File 'lib/roxbury/empty_working_hours.rb', line 4

def initialize
  super begins_at: 0, ends_at: 0
end

Instance Method Details

#ends_before?(_timestamp) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/roxbury/empty_working_hours.rb', line 16

def ends_before? _timestamp
  false
end

#include?(_timestamp) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/roxbury/empty_working_hours.rb', line 8

def include? _timestamp
  false
end

#non_working?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/roxbury/empty_working_hours.rb', line 20

def non_working?
  true
end

#starts_after?(_timestamp) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/roxbury/empty_working_hours.rb', line 12

def starts_after? _timestamp
  false
end