Class: Repeatable::Expression::Difference
- Defined in:
- lib/repeatable/expression/difference.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #include?(date) ⇒ Boolean
-
#initialize(included:, excluded:) ⇒ Difference
constructor
A new instance of Difference.
Methods inherited from Base
===, #deconstruct_keys, #difference, #intersection, #to_h, #union
Constructor Details
#initialize(included:, excluded:) ⇒ Difference
Returns a new instance of Difference.
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) ⇒ Object
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 |