Class: FixnumVariable
- Inherits:
-
TypeVariable
- Object
- Array
- BaseVariable
- TypeVariable
- FixnumVariable
- Defined in:
- lib/core/variable/FixnumVariable.rb
Instance Attribute Summary
Attributes inherited from TypeVariable
Attributes inherited from BaseVariable
#instance_variable, #uniq_id_history, #value, #variable_id
Attributes included from Variable
Instance Method Summary collapse
-
#destructive_instance_calls(available = []) ⇒ Object
Returns an array of desctructive instance calls given the available variables.
-
#initialize(val, id = nil) ⇒ FixnumVariable
constructor
A new instance of FixnumVariable.
-
#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.
- #to_declaration ⇒ Object
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.
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.
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_declaration ⇒ Object
7 8 9 |
# File 'lib/core/variable/FixnumVariable.rb', line 7 def to_declaration return VariableDeclaration.new('FixnumVariable',@value.to_declaration) end |