Module: Bmg::Operator

Includes:
Relation
Included in:
Binary, Nary, Unary
Defined in:
lib/bmg/operator.rb,
lib/bmg/operator/join.rb,
lib/bmg/operator/page.rb,
lib/bmg/operator/group.rb,
lib/bmg/operator/image.rb,
lib/bmg/operator/minus.rb,
lib/bmg/operator/union.rb,
lib/bmg/operator/allbut.rb,
lib/bmg/operator/extend.rb,
lib/bmg/operator/rename.rb,
lib/bmg/operator/unwrap.rb,
lib/bmg/operator/project.rb,
lib/bmg/operator/rxmatch.rb,
lib/bmg/operator/ungroup.rb,
lib/bmg/operator/autowrap.rb,
lib/bmg/operator/matching.rb,
lib/bmg/operator/restrict.rb,
lib/bmg/operator/constants.rb,
lib/bmg/operator/summarize.rb,
lib/bmg/operator/transform.rb,
lib/bmg/operator/shared/nary.rb,
lib/bmg/operator/not_matching.rb,
lib/bmg/operator/shared/unary.rb,
lib/bmg/operator/autosummarize.rb,
lib/bmg/operator/shared/binary.rb

Defined Under Namespace

Modules: Binary, Nary, Unary Classes: Allbut, Autosummarize, Autowrap, Constants, Extend, Group, Image, Join, Matching, Minus, NotMatching, Page, Project, Rename, Restrict, Rxmatch, Summarize, Transform, Ungroup, Union, Unwrap

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Relation

#_count, #bind, #count, #debug, #delete, empty, #empty?, #insert, new, #one, #one_or_nil, #to_ast, #to_csv, #to_json, #to_xlsx, #update, #visit, #with_type, #with_type_attrlist, #with_typecheck, #without_typecheck, #y_by_x, #ys_by_x

Methods included from Algebra

#allbut, #autosummarize, #autowrap, #constants, #extend, #group, #image, #join, #left_join, #matching, #materialize, #minus, #not_matching, #page, #project, #rename, #restrict, #spied, #summarize, #transform, #ungroup, #union, #unspied, #unwrap

Methods included from Algebra::Shortcuts

#cross_product, #exclude, #image, #images, #join, #left_join, #matching, #not_matching, #prefix, #rxmatch, #suffix, #ungroup, #unwrap, #where

Instance Attribute Details

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/bmg/operator.rb', line 5

def type
  @type
end

Instance Method Details

#inspectObject



18
19
20
21
22
23
24
25
# File 'lib/bmg/operator.rb', line 18

def inspect
  str = "(#{self.class.name.split('::').last.downcase}\n"
  str << operands.map{|op| op.inspect.gsub(/^/m, "  ") }.join("\n")
  str << "\n"
  str << args.map{|a| a.inspect.gsub(/^/m, "  ") }.join("\n")
  str << ")"
  str
end

#to_sObject



9
10
11
12
13
14
15
16
# File 'lib/bmg/operator.rb', line 9

def to_s
  str = "(#{self.class.name.split('::').last.downcase}\n"
  str << operands.map{|op| op.to_s.gsub(/^/m, "  ") }.join("\n")
  str << "\n"
  str << args.map{|a| a.to_s.gsub(/^/m, "  ") }.join("\n")
  str << ")"
  str
end