class Utils::IRB::Shell::WrapperBase
wrapped objects.
name conversion and provides common methods for accessing and comparing
associate descriptive information with underlying objects. It handles
This class provides a foundation for creating wrapper objects that
Base class for wrapping objects with descriptive metadata.
def <=>(other)
-
(Integer)
- -1 if this object's name is less than the other's,
Parameters:
-
other
(Object
) -- the other object to compare against
def <=>(other) @name <=> other.name end
def ==(name)
-
(Object)
- returns the assigned name value
Parameters:
-
name
(Object
) -- the name value to be assigned
def ==(name) @name = name end
def hash
-
(Integer)
- the hash value used for object identification
def hash @name.hash end
def initialize(name)
-
name
(Object
) -- the input name to be converted to a string
def initialize(name) @name = case when name.respond_to?(:to_str) name.to_str when name.respond_to?(:to_sym) name.to_sym.to_s else name.to_s end end