Module: Bmg::Algebra
- Included in:
- Relation
- Defined in:
- lib/bmg/algebra.rb
Constant Summary collapse
- METHODS =
[ :allbut, :autowrap, :autosummarize, :constants, :extend, :group, :image, :matching, :page, :project, :rename, :restrict, :rxmatch, :union ]
Instance Method Summary collapse
- #allbut(butlist = []) ⇒ Object
- #autosummarize(by = [], summarization = {}) ⇒ Object
- #autowrap(options = {}) ⇒ Object
- #constants(cs = {}) ⇒ Object
- #extend(extension = {}) ⇒ Object
- #group(attrs, as = :group, options = {}) ⇒ Object
- #image(right, as = :image, on = [], options = {}) ⇒ Object
- #matching(right, on = []) ⇒ Object
- #page(ordering, page_index, options) ⇒ Object
- #project(attrlist = []) ⇒ Object
- #rename(renaming = {}) ⇒ Object
- #restrict(predicate) ⇒ Object
- #rxmatch(attrs, matcher, options = {}) ⇒ Object
- #spied(spy) ⇒ Object
- #union(other, options = {}) ⇒ Object
- #unspied ⇒ Object
Instance Method Details
#allbut(butlist = []) ⇒ Object
21 22 23 |
# File 'lib/bmg/algebra.rb', line 21 def allbut(butlist = []) _allbut self.type.allbut(butlist), butlist end |
#autosummarize(by = [], summarization = {}) ⇒ Object
39 40 41 |
# File 'lib/bmg/algebra.rb', line 39 def autosummarize(by = [], summarization = {}) _autosummarize type = self.type.autosummarize(by, summarization), by, summarization end |
#autowrap(options = {}) ⇒ Object
30 31 32 |
# File 'lib/bmg/algebra.rb', line 30 def autowrap( = {}) _autowrap self.type.autowrap(), end |
#constants(cs = {}) ⇒ Object
48 49 50 |
# File 'lib/bmg/algebra.rb', line 48 def constants(cs = {}) _constants self.type.constants(cs), cs end |
#extend(extension = {}) ⇒ Object
57 58 59 |
# File 'lib/bmg/algebra.rb', line 57 def extend(extension = {}) _extend self.type.extend(extension), extension end |
#group(attrs, as = :group, options = {}) ⇒ Object
66 67 68 |
# File 'lib/bmg/algebra.rb', line 66 def group(attrs, as = :group, = {}) _group self.type.group(attrs, as), attrs, as, end |
#image(right, as = :image, on = [], options = {}) ⇒ Object
75 76 77 |
# File 'lib/bmg/algebra.rb', line 75 def image(right, as = :image, on = [], = {}) _image self.type.image(right, as, on, ), right, as, on, end |
#matching(right, on = []) ⇒ Object
84 85 86 |
# File 'lib/bmg/algebra.rb', line 84 def matching(right, on = []) _matching self.type.matching(right, on), right, on end |
#page(ordering, page_index, options) ⇒ Object
93 94 95 |
# File 'lib/bmg/algebra.rb', line 93 def page(ordering, page_index, ) _page self.type.page(ordering, page_index, ), ordering, page_index, end |
#project(attrlist = []) ⇒ Object
102 103 104 |
# File 'lib/bmg/algebra.rb', line 102 def project(attrlist = []) _project self.type.project(attrlist), attrlist end |
#rename(renaming = {}) ⇒ Object
111 112 113 |
# File 'lib/bmg/algebra.rb', line 111 def rename(renaming = {}) _rename self.type.rename(renaming), renaming end |
#restrict(predicate) ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/bmg/algebra.rb', line 120 def restrict(predicate) predicate = Predicate.coerce(predicate) if predicate.tautology? self else type = self.type.restrict(predicate) if predicate.contradiction? Relation.empty(type) else begin _restrict type, predicate rescue Predicate::NotSupportedError Operator::Restrict.new(type, self, predicate) end end end end |
#rxmatch(attrs, matcher, options = {}) ⇒ Object
143 144 145 |
# File 'lib/bmg/algebra.rb', line 143 def rxmatch(attrs, matcher, = {}) _rxmatch type.rxmatch(attrs, matcher, ), attrs, matcher, end |
#spied(spy) ⇒ Object
161 162 163 164 |
# File 'lib/bmg/algebra.rb', line 161 def spied(spy) return self if spy.nil? Relation::Spied.new(self, spy) end |
#union(other, options = {}) ⇒ Object
152 153 154 |
# File 'lib/bmg/algebra.rb', line 152 def union(other, = {}) _union self.type.union(other.type), other, end |
#unspied ⇒ Object
166 167 168 |
# File 'lib/bmg/algebra.rb', line 166 def unspied self end |