Class: Alf::Algebra::Operand::Proxy

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Alf::Algebra::Operand

#attr_list, coerce, #resulting_type, #to_ascii_tree, #to_relation, #type_check

Constructor Details

#initialize(subject) ⇒ Proxy

Returns a new instance of Proxy


7
8
9
# File 'lib/alf/algebra/operand/proxy.rb', line 7

def initialize(subject)
  @subject = subject
end

Instance Attribute Details

#subjectObject (readonly)

Returns the value of attribute subject


10
11
12
# File 'lib/alf/algebra/operand/proxy.rb', line 10

def subject
  @subject
end

Instance Method Details

#headingObject


12
13
14
15
# File 'lib/alf/algebra/operand/proxy.rb', line 12

def heading
  return subject.heading if subject.respond_to?(:heading)
  super
end

#inspectObject


36
37
38
# File 'lib/alf/algebra/operand/proxy.rb', line 36

def inspect
  "Operand::Proxy(#{subject})"
end

#keysObject


17
18
19
20
# File 'lib/alf/algebra/operand/proxy.rb', line 17

def keys
  return subject.keys if subject.respond_to?(:keys)
  super
end

#to_cog(*args, &bl) ⇒ Object


22
23
24
25
# File 'lib/alf/algebra/operand/proxy.rb', line 22

def to_cog(*args, &bl)
  return subject.to_cog(*args, &bl) if subject.respond_to?(:to_cog)
  Alf::Engine::Leaf.new(subject)
end

#to_relvarObject


27
28
29
30
# File 'lib/alf/algebra/operand/proxy.rb', line 27

def to_relvar
  return subject.to_relvar if subject.respond_to?(:to_relvar)
  Relvar::ReadOnly.new(self)
end

#to_sObject


32
33
34
# File 'lib/alf/algebra/operand/proxy.rb', line 32

def to_s
  subject.to_s
end