Class: VariableContainer

Inherits:
BaseVariable show all
Defined in:
lib/core/variable/VariableContainer.rb

Instance Attribute Summary collapse

Attributes inherited from BaseVariable

#instance_variable, #uniq_id_history, #value, #variable_id

Attributes included from Variable

#scope_id, #uniq_id

Instance Method Summary collapse

Methods inherited from BaseVariable

#destructive_instance_calls, #find_actual_variable, #instance_calls, #realised?, reset_global_id, #returning_instance_calls, #write, #write_with_uniq_id

Methods included from Variable

#increament_uniq_id!, #meets_requirements?, reset_global_id, #to_var, variable_id

Methods included from VariableIncluded

#find_actual_variable

Methods inherited from Array

#cauldron_method_calls, #contains?, #select_all, #to_declaration, #to_intrinsic, #to_literal, #to_var, #write

Constructor Details

#initializeVariableContainer

Returns a new instance of VariableContainer.



5
6
7
8
9
# File 'lib/core/variable/VariableContainer.rb', line 5

def initialize
  super()
  
  @realised = false
end

Instance Attribute Details

#realised=(value) ⇒ Object (writeonly)

Sets the attribute realised

Parameters:

  • value

    the value to set the attribute realised to.



3
4
5
# File 'lib/core/variable/VariableContainer.rb', line 3

def realised=(value)
  @realised = value
end

Instance Method Details

#copyObject

Returns a duplicate of this variable container.



13
14
15
16
17
18
19
20
21
# File 'lib/core/variable/VariableContainer.rb', line 13

def copy
  result = VariableContainer.new(){{:variable_id => self.variable_id,:uniq_id=>@uniq_id, :uniq_id_history=>@uniq_id_history.copy}}
  result.instance_variable = @instance_variable    
  self.each do |x|
    result.push(x)
  end
  result.realised = @realised
  return result        
end

#variableObject

TODO Write description - hack for instance calls



24
25
26
# File 'lib/core/variable/VariableContainer.rb', line 24

def variable
  return self
end