Class: Repeatable::Expression::Base Abstract
- Inherits:
-
Object
- Object
- Repeatable::Expression::Base
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/repeatable/expression/base.rb
Overview
This class is abstract.
It cannot be directly instantiated. Subclasses must implement the ‘abstract` methods below.
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #deconstruct_keys(_keys) ⇒ Hash{Symbol => Types::SymbolHash, Array<Types::SymbolHash>}
- #difference(other) ⇒ Expression::Difference (also: #-)
- #include?(date) ⇒ Boolean abstract
- #intersection(other) ⇒ Expression::Intersection (also: #&)
- #to_h ⇒ Hash{Symbol => Types::SymbolHash, Array<Types::SymbolHash>}
- #union(other) ⇒ Expression::Union (also: #+, #|)
Class Method Details
.===(other) ⇒ Boolean
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) ⇒ Hash{Symbol => Types::SymbolHash, Array<Types::SymbolHash>}
31 32 33 |
# File 'lib/repeatable/expression/base.rb', line 31 def deconstruct_keys(_keys) to_h end |
#difference(other) ⇒ Expression::Difference 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
This method is abstract.
22 23 |
# File 'lib/repeatable/expression/base.rb', line 22 def include?(date) end |
#intersection(other) ⇒ Expression::Intersection Also known as: &
43 44 45 |
# File 'lib/repeatable/expression/base.rb', line 43 def intersection(other) Intersection.new(self, other) end |
#to_h ⇒ Hash{Symbol => Types::SymbolHash, Array<Types::SymbolHash>}
26 27 28 |
# File 'lib/repeatable/expression/base.rb', line 26 def to_h {hash_key => hash_value} end |
#union(other) ⇒ Expression::Union Also known as: +, |
36 37 38 |
# File 'lib/repeatable/expression/base.rb', line 36 def union(other) Union.new(self, other) end |