Class: Axiom::Relation::Operation::Unwrap
- Inherits:
-
Axiom::Relation
- Object
- Axiom::Relation
- Axiom::Relation::Operation::Unwrap
- Includes:
- Unary
- Defined in:
- lib/axiom/relation/operation/unwrap.rb
Overview
A class representing a unwrapped relation
Defined Under Namespace
Modules: Methods
Instance Attribute Summary collapse
-
#attribute ⇒ Attribute::Relation
readonly
private
The unwrapped attribute.
Attributes included from Operation::Unary
Attributes inherited from Axiom::Relation
Instance Method Summary collapse
-
#each {|tuple| ... } ⇒ self
Iterate over each tuple in the set.
-
#initialize(operand, name) ⇒ undefined
constructor
private
Initialize a unwrapped relation.
Methods inherited from Axiom::Relation
#==, #[], #directions, #empty?, #include?, #materialize, #materialized?, new, #replace
Methods included from Visitable
Constructor Details
#initialize(operand, name) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a unwrapped relation
28 29 30 31 32 33 |
# File 'lib/axiom/relation/operation/unwrap.rb', line 28 def initialize(operand, name) super(operand) @attribute = header[name] @outer = header - [attribute] @header = @outer.extend(attribute.header) end |
Instance Attribute Details
#attribute ⇒ Attribute::Relation (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The unwrapped attribute
17 18 19 |
# File 'lib/axiom/relation/operation/unwrap.rb', line 17 def attribute @attribute end |
Instance Method Details
#each {|tuple| ... } ⇒ self
Iterate over each tuple in the set
49 50 51 52 53 54 55 |
# File 'lib/axiom/relation/operation/unwrap.rb', line 49 def each return to_enum unless block_given? operand.each do |tuple| yield tuple.project(@outer).join(header, tuple[attribute]) end self end |