Class: Utils::IRB::Shell::WrapperBase
- Includes:
- Comparable
- Defined in:
- lib/utils/irb.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#description ⇒ Object
(also: #to_str, #inspect, #to_s)
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(name) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(name) ⇒ WrapperBase
constructor
A new instance of WrapperBase.
Constructor Details
#initialize(name) ⇒ WrapperBase
Returns a new instance of WrapperBase.
129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/utils/irb.rb', line 129 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 |
Instance Attribute Details
#description ⇒ Object (readonly) Also known as: to_str, inspect, to_s
Returns the value of attribute description.
143 144 145 |
# File 'lib/utils/irb.rb', line 143 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
141 142 143 |
# File 'lib/utils/irb.rb', line 141 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
161 162 163 |
# File 'lib/utils/irb.rb', line 161 def <=>(other) @name <=> other.name end |
#==(name) ⇒ Object Also known as: eql?
151 152 153 |
# File 'lib/utils/irb.rb', line 151 def ==(name) @name = name end |
#hash ⇒ Object
157 158 159 |
# File 'lib/utils/irb.rb', line 157 def hash @name.hash end |