Class: Cheri::Explorer::ValueType

Inherits:
Object
  • Object
show all
Defined in:
lib/cheri/explorer/explorer.rb

Overview

ConstRec

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ValueType

Returns a new instance of ValueType.



162
163
164
165
166
# File 'lib/cheri/explorer/explorer.rb', line 162

def initialize(value)
  @z = value.class.to_s rescue '?'
  @i = value.__id__ rescue '?'
  @v = value.to_s rescue '?'
end

Instance Method Details

#<=>(other) ⇒ Object



176
177
178
179
180
181
182
# File 'lib/cheri/explorer/explorer.rb', line 176

def <=>(other)
  if ValueRec === other
    value <=> other.value
  else
    value <=> (other.to_s rescue '')
  end
end

#clazzObject



167
168
169
# File 'lib/cheri/explorer/explorer.rb', line 167

def clazz
  @z  
end

#idObject



170
171
172
# File 'lib/cheri/explorer/explorer.rb', line 170

def id
  @i  
end

#to_aObject Also known as: to_ary



183
184
185
# File 'lib/cheri/explorer/explorer.rb', line 183

def to_a
  [@v,@z,@i]  
end

#valueObject



173
174
175
# File 'lib/cheri/explorer/explorer.rb', line 173

def value
  @v  
end