Class: Cheri::Explorer::ConstRec
Overview
Constant Summary
Constants inherited
from ObjectRec
ObjectRec::MaxDataLength
Instance Method Summary
collapse
Methods inherited from ObjectRec
#ancestors, #clazz, #id, #superclazz, #to_s, #value, #vars
Constructor Details
#initialize(parent, name, obj) ⇒ ConstRec
Returns a new instance of ConstRec.
136
137
138
139
140
141
142
|
# File 'lib/cheri/explorer/explorer.rb', line 136
def initialize(parent,name,obj)
raise Cheri.type_error(name,String) unless String === name
raise Cheri.type_error(parent,String) if parent && !(String === parent)
super(obj)
@p = parent if parent
@n = name
end
|
Instance Method Details
#<=>(other) ⇒ Object
152
153
154
155
156
157
158
|
# File 'lib/cheri/explorer/explorer.rb', line 152
def <=>(other)
if ConstRec === other
name <=> other.name
else
name <=> (other.to_s rescue '')
end
end
|
#name ⇒ Object
146
147
148
|
# File 'lib/cheri/explorer/explorer.rb', line 146
def name
@n
end
|
#parent ⇒ Object
143
144
145
|
# File 'lib/cheri/explorer/explorer.rb', line 143
def parent
@p
end
|
#qname ⇒ Object
149
150
151
|
# File 'lib/cheri/explorer/explorer.rb', line 149
def qname
@p ? "#{@p}::#{@n}" : @n
end
|