Module: Bmg::Algebra
- Includes:
- Shortcuts
- Included in:
- Relation
- Defined in:
- lib/bmg/algebra.rb,
lib/bmg/algebra/shortcuts.rb
Defined Under Namespace
Modules: Shortcuts
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
-
#join(right, on = []) ⇒ Object
-
#matching(right, on = []) ⇒ Object
-
#not_matching(right, on = []) ⇒ Object
-
#page(ordering, page_index, options) ⇒ Object
-
#project(attrlist = []) ⇒ Object
-
#rename(renaming = {}) ⇒ Object
-
#restrict(predicate) ⇒ Object
-
#spied(spy) ⇒ Object
-
#union(other, options = {}) ⇒ Object
-
#unspied ⇒ Object
Methods included from Shortcuts
#prefix, #rxmatch, #suffix
Instance Method Details
#allbut(butlist = []) ⇒ Object
4
5
6
7
|
# File 'lib/bmg/algebra.rb', line 4
def allbut(butlist = [])
return self if butlist.empty?
_allbut self.type.allbut(butlist), butlist
end
|
#autosummarize(by = [], summarization = {}) ⇒ Object
23
24
25
|
# File 'lib/bmg/algebra.rb', line 23
def autosummarize(by = [], summarization = {})
_autosummarize type = self.type.autosummarize(by, summarization), by, summarization
end
|
#autowrap(options = {}) ⇒ Object
14
15
16
|
# File 'lib/bmg/algebra.rb', line 14
def autowrap(options = {})
_autowrap self.type.autowrap(options), options
end
|
#constants(cs = {}) ⇒ Object
32
33
34
|
# File 'lib/bmg/algebra.rb', line 32
def constants(cs = {})
_constants self.type.constants(cs), cs
end
|
#extend(extension = {}) ⇒ Object
41
42
43
|
# File 'lib/bmg/algebra.rb', line 41
def extend(extension = {})
_extend self.type.extend(extension), extension
end
|
#group(attrs, as = :group, options = {}) ⇒ Object
50
51
52
|
# File 'lib/bmg/algebra.rb', line 50
def group(attrs, as = :group, options = {})
_group self.type.group(attrs, as), attrs, as, options
end
|
#image(right, as = :image, on = [], options = {}) ⇒ Object
59
60
61
|
# File 'lib/bmg/algebra.rb', line 59
def image(right, as = :image, on = [], options = {})
_image self.type.image(right.type, as, on, options), right, as, on, options
end
|
#join(right, on = []) ⇒ Object
68
69
70
|
# File 'lib/bmg/algebra.rb', line 68
def join(right, on = [])
_join self.type.join(right.type, on), right, on
end
|
#matching(right, on = []) ⇒ Object
77
78
79
|
# File 'lib/bmg/algebra.rb', line 77
def matching(right, on = [])
_matching self.type.matching(right.type, on), right, on
end
|
#not_matching(right, on = []) ⇒ Object
86
87
88
|
# File 'lib/bmg/algebra.rb', line 86
def not_matching(right, on = [])
_not_matching self.type.not_matching(right.type, on), right, on
end
|
#page(ordering, page_index, options) ⇒ Object
95
96
97
|
# File 'lib/bmg/algebra.rb', line 95
def page(ordering, page_index, options)
_page self.type.page(ordering, page_index, options), ordering, page_index, options
end
|
#project(attrlist = []) ⇒ Object
104
105
106
|
# File 'lib/bmg/algebra.rb', line 104
def project(attrlist = [])
_project self.type.project(attrlist), attrlist
end
|
#rename(renaming = {}) ⇒ Object
113
114
115
|
# File 'lib/bmg/algebra.rb', line 113
def rename(renaming = {})
_rename self.type.rename(renaming), renaming
end
|
#restrict(predicate) ⇒ Object
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
# File 'lib/bmg/algebra.rb', line 122
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
|
#spied(spy) ⇒ Object
155
156
157
158
|
# File 'lib/bmg/algebra.rb', line 155
def spied(spy)
return self if spy.nil?
Relation::Spied.new(self, spy)
end
|
#union(other, options = {}) ⇒ Object
145
146
147
148
|
# File 'lib/bmg/algebra.rb', line 145
def union(other, options = {})
return self if other.is_a?(Relation::Empty)
_union self.type.union(other.type), other, options
end
|
#unspied ⇒ Object
160
161
162
|
# File 'lib/bmg/algebra.rb', line 160
def unspied
self
end
|