class Repeatable::Expression::Difference

Attributes

excluded[R]
included[R]

Public Class Methods

new(included:, excluded:) click to toggle source
# File lib/repeatable/expression/difference.rb, line 7
def initialize(included:, excluded:)
  @included = included
  @excluded = excluded
end

Public Instance Methods

==(other) click to toggle source
# File lib/repeatable/expression/difference.rb, line 18
def ==(other)
  other.is_a?(self.class) &&
    included == other.included &&
    excluded == other.excluded
end
include?(date) click to toggle source
# File lib/repeatable/expression/difference.rb, line 13
def include?(date)
  included.include?(date) && !excluded.include?(date)
end

Protected Instance Methods

hash_value() click to toggle source
# File lib/repeatable/expression/difference.rb, line 33
def hash_value
  {included: included.to_h, excluded: excluded.to_h}
end