Class: Cheri::Explorer::ValueType
- Inherits:
-
Object
- Object
- Cheri::Explorer::ValueType
- Defined in:
- lib/cheri/explorer/explorer.rb
Overview
ConstRec
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #clazz ⇒ Object
- #id ⇒ Object
-
#initialize(value) ⇒ ValueType
constructor
A new instance of ValueType.
- #to_a ⇒ Object (also: #to_ary)
- #value ⇒ Object
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 |
#clazz ⇒ Object
167 168 169 |
# File 'lib/cheri/explorer/explorer.rb', line 167 def clazz @z end |
#id ⇒ Object
170 171 172 |
# File 'lib/cheri/explorer/explorer.rb', line 170 def id @i end |
#to_a ⇒ Object Also known as: to_ary
183 184 185 |
# File 'lib/cheri/explorer/explorer.rb', line 183 def to_a [@v,@z,@i] end |
#value ⇒ Object
173 174 175 |
# File 'lib/cheri/explorer/explorer.rb', line 173 def value @v end |