Class: Repeatable::Expression::Base
- Inherits:
-
Object
- Object
- Repeatable::Expression::Base
- Defined in:
- lib/repeatable/expression/base.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #difference(other) ⇒ Object (also: #-)
- #include?(_date) ⇒ Boolean
- #intersection(other) ⇒ Object (also: #&)
- #to_h ⇒ Object
- #union(other) ⇒ Object (also: #+, #|)
Class Method Details
.===(other) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/repeatable/expression/base.rb', line 4 def self.===(other) case other when Class other.ancestors.include?(self) else super end end |
Instance Method Details
#difference(other) ⇒ Object Also known as: -
38 39 40 |
# File 'lib/repeatable/expression/base.rb', line 38 def difference(other) Difference.new(included: self, excluded: other) end |
#include?(_date) ⇒ Boolean
13 14 15 16 17 18 |
# File 'lib/repeatable/expression/base.rb', line 13 def include?(_date) fail( NotImplementedError, "Don't use Expression::Base directly. Subclasses must implement `#include?`" ) end |
#intersection(other) ⇒ Object Also known as: &
33 34 35 |
# File 'lib/repeatable/expression/base.rb', line 33 def intersection(other) Intersection.new(self, other) end |
#to_h ⇒ Object
20 21 22 23 24 25 |
# File 'lib/repeatable/expression/base.rb', line 20 def to_h fail( NotImplementedError, "Don't use Expression::Base directly. Subclasses must implement `#to_h`" ) end |
#union(other) ⇒ Object Also known as: +, |
27 28 29 |
# File 'lib/repeatable/expression/base.rb', line 27 def union(other) Union.new(self, other) end |