Class: FixnumVariable

Inherits:
TypeVariable show all
Defined in:
lib/core/variable/FixnumVariable.rb

Instance Attribute Summary

Attributes inherited from TypeVariable

#value

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 TypeVariable

#cauldron_method_calls, #copy, #describe, #equivalent?, #literalisable?, #literalise, #realised?, #to_literal_string, #variable_id=

Methods inherited from BaseVariable

#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, #variable

Methods inherited from Array

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

Constructor Details

#initialize(val, id = nil) ⇒ FixnumVariable

Returns a new instance of FixnumVariable.



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

def initialize(val,id=nil)
  super(val,id)
end

Instance Method Details

#destructive_instance_calls(available = []) ⇒ Object

Returns an array of desctructive instance calls given the available variables.

Parameters:

  • available (defaults to: [])

    An array of other variables that can be used as parameters.



31
32
33
# File 'lib/core/variable/FixnumVariable.rb', line 31

def destructive_instance_calls(available=[])
  return []
end

#pass_as?(variable_type) ⇒ Boolean

Returns true if the variable type is Fixnum, this is used to determine whether a BlockVariable or VariableContainer can be used as a particular variable type.

Returns:



20
21
22
23
# File 'lib/core/variable/FixnumVariable.rb', line 20

def pass_as?(variable_type)
  return true if variable_type==FixnumVariable
  return false
end

#to_declarationObject



7
8
9
# File 'lib/core/variable/FixnumVariable.rb', line 7

def to_declaration
  return VariableDeclaration.new('FixnumVariable',@value.to_declaration)
end