Class: Repeatable::Expression::Difference
- Inherits:
-
Base
- Object
- Base
- Repeatable::Expression::Difference
show all
- Defined in:
- lib/repeatable/expression/difference.rb
Instance Method Summary
collapse
Methods inherited from Base
===, #deconstruct_keys, #difference, #intersection, #to_h, #union
Constructor Details
#initialize(included:, excluded:) ⇒ void
7
8
9
10
|
# File 'lib/repeatable/expression/difference.rb', line 7
def initialize(included:, excluded:)
@included = included
@excluded = excluded
end
|
Instance Method Details
#==(other) ⇒ Boolean
18
19
20
21
22
|
# File 'lib/repeatable/expression/difference.rb', line 18
def ==(other)
other.is_a?(self.class) &&
included == other.included &&
excluded == other.excluded
end
|
#include?(date) ⇒ Boolean
13
14
15
|
# File 'lib/repeatable/expression/difference.rb', line 13
def include?(date)
included.include?(date) && !excluded.include?(date)
end
|