Class: Repeatable::Expression::Base

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Defined in:
lib/repeatable/expression/base.rb

Direct Known Subclasses

Date, Difference, Set

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.===(other) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/repeatable/expression/base.rb', line 12

def self.===(other)
  case other
  when Class
    other.ancestors.include?(self)
  else
    super
  end
end

Instance Method Details

#deconstruct_keys(_keys) ⇒ Object



31
32
33
# File 'lib/repeatable/expression/base.rb', line 31

def deconstruct_keys(_keys)
  to_h
end

#difference(other) ⇒ Object Also known as: -



49
50
51
# File 'lib/repeatable/expression/base.rb', line 49

def difference(other)
  Difference.new(included: self, excluded: other)
end

#include?(date) ⇒ Boolean

Returns:

  • (Boolean)


22
23
# File 'lib/repeatable/expression/base.rb', line 22

def include?(date)
end

#intersection(other) ⇒ Object Also known as: &



43
44
45
# File 'lib/repeatable/expression/base.rb', line 43

def intersection(other)
  Intersection.new(self, other)
end

#to_hObject



26
27
28
# File 'lib/repeatable/expression/base.rb', line 26

def to_h
  {hash_key => hash_value}
end

#union(other) ⇒ Object Also known as: +, |



36
37
38
# File 'lib/repeatable/expression/base.rb', line 36

def union(other)
  Union.new(self, other)
end