Class: Bmg::Operator::Unwrap

Inherits:
Object
  • Object
show all
Includes:
Unary
Defined in:
lib/bmg/operator/unwrap.rb

Instance Attribute Summary

Attributes included from Bmg::Operator

#type

Instance Method Summary collapse

Methods included from Unary

#bind

Methods included from Bmg::Operator

#inspect, #to_s

Methods included from Relation

#_count, #bind, #count, #debug, #delete, empty, #empty?, #insert, new, #one, #one_or_nil, #to_csv, #to_json, #to_xlsx, #type, #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

Constructor Details

#initialize(type, operand, attrs) ⇒ Unwrap

Returns a new instance of Unwrap.



6
7
8
9
10
# File 'lib/bmg/operator/unwrap.rb', line 6

def initialize(type, operand, attrs)
  @type = type
  @operand = operand
  @attrs = attrs
end

Instance Method Details

#each(&bl) ⇒ Object



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

def each(&bl)
  return to_enum unless block_given?
  operand.each do |tuple|
    yield tuple_unwrap(tuple)
  end
end

#to_astObject



25
26
27
# File 'lib/bmg/operator/unwrap.rb', line 25

def to_ast
  [ :unwrap, operand.to_ast, attrs ]
end