Class: Axiom::Relation::Base

Inherits:
Axiom::Relation show all
Defined in:
lib/axiom/relation/base.rb

Overview

A class that represents a base relation

Instance Attribute Summary collapse

Attributes inherited from Axiom::Relation

#header

Instance Method Summary collapse

Methods inherited from Axiom::Relation

#==, #[], #directions, #each, #empty?, #include?, #materialize, #materialized?, new, #one, #replace

Methods included from Visitable

#accept

Constructor Details

#initialize(name, header, tuples = Empty::ZERO_TUPLE) ⇒ 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 base relation

Parameters:

  • name (#to_s)

    the relation name

  • header (Header, #to_ary)

    the relation header

  • tuples (Enumerable) (defaults to: Empty::ZERO_TUPLE)

    the relation tuples



32
33
34
35
# File 'lib/axiom/relation/base.rb', line 32

def initialize(name, header, tuples = Empty::ZERO_TUPLE)
  super(header, tuples)
  @name = freeze_object(name.to_s)
end

Instance Attribute Details

#name#to_s (readonly)

The base relation name

Examples:

name = base.name

Returns:

  • (#to_s)


18
19
20
# File 'lib/axiom/relation/base.rb', line 18

def name
  @name
end