Module: BOAST::Inspectable

Included in:
CKernel, ConstArray, ControlStructure, Dimension, Expression, FuncCall, Pragma, Procedure, Ternary, Variable
Defined in:
lib/BOAST/Inspectable.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/BOAST/Inspectable.rb', line 8

def inspect
  if BOAST::boast_inspect? then
    variables = instance_variables.map{ |v|
      instance_variable_get(v) ? "#{v}=#{instance_variable_get(v).inspect}" : nil
    }.reject{ |v| v.nil? }.join(", ")
    "#<#{self.class}:0x#{(self.object_id<<1).to_s(16)}#{variables == "" ? "" : " #{variables}" }>" 
  else
    to_s
  end
end