Class: Alf::Algebra::Operand::Named

Inherits:
Object
  • Object
show all
Includes:
Alf::Algebra::Operand
Defined in:
lib/alf-algebra/alf/algebra/operand/named.rb

Instance Attribute Summary collapse

Attributes included from Support::Bindable

#connection

Instance Method Summary collapse

Methods included from Alf::Algebra::Operand

#attr_list, coerce, #to_cog, #to_dot, #to_relation

Methods included from Support::Bindable

#bind, #bound?, #connection!

Constructor Details

#initialize(name, connection = nil) ⇒ Named

Returns a new instance of Named.



7
8
9
10
# File 'lib/alf-algebra/alf/algebra/operand/named.rb', line 7

def initialize(name, connection = nil)
  @name = name
  @connection = connection
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/alf-algebra/alf/algebra/operand/named.rb', line 11

def name
  @name
end

Instance Method Details

#headingObject



17
18
19
# File 'lib/alf-algebra/alf/algebra/operand/named.rb', line 17

def heading
  connection!.heading(name)
end

#keysObject



13
14
15
# File 'lib/alf-algebra/alf/algebra/operand/named.rb', line 13

def keys
  connection!.keys(name)
end

#to_lispyObject



29
30
31
# File 'lib/alf-algebra/alf/algebra/operand/named.rb', line 29

def to_lispy
  name.to_s
end

#to_relvarObject



21
22
23
# File 'lib/alf-algebra/alf/algebra/operand/named.rb', line 21

def to_relvar
  Relvar::Base.new(name, connection)
end

#to_sObject



25
26
27
# File 'lib/alf-algebra/alf/algebra/operand/named.rb', line 25

def to_s
  "Operand::Named(#{name.inspect})"
end