Class: Axiom::Relation::Base
- Inherits:
-
Axiom::Relation
- Object
- Axiom::Relation
- Axiom::Relation::Base
- Defined in:
- lib/axiom/relation/base.rb
Overview
A class that represents a base relation
Instance Attribute Summary collapse
-
#name ⇒ Symbol
readonly
The base relation name.
Attributes inherited from Axiom::Relation
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Compare the base relation with other relation for equivalency.
-
#initialize(name, header, tuples = Empty::ZERO_TUPLE) ⇒ undefined
constructor
private
Initialize a base relation.
Methods inherited from Axiom::Relation
#[], #directions, #each, #empty?, #include?, #materialize, #materialized?, new, #replace
Methods included from Visitable
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
32 33 34 35 |
# File 'lib/axiom/relation/base.rb', line 32 def initialize(name, header, tuples = Empty::ZERO_TUPLE) super(header, tuples) @name = name.to_sym end |
Instance Attribute Details
#name ⇒ Symbol (readonly)
The base relation name
18 19 20 |
# File 'lib/axiom/relation/base.rb', line 18 def name @name end |
Instance Method Details
#==(other) ⇒ Boolean
Compare the base relation with other relation for equivalency
48 49 50 |
# File 'lib/axiom/relation/base.rb', line 48 def ==(other) super && (!other.respond_to?(:name) || name == other.name) end |