Class: USTC::Admirable
- Inherits:
-
Object
- Object
- USTC::Admirable
- Defined in:
- lib/dalao.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #admire ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(name) ⇒ Admirable
constructor
A new instance of Admirable.
Constructor Details
#initialize(name) ⇒ Admirable
Returns a new instance of Admirable.
7 8 9 |
# File 'lib/dalao.rb', line 7 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/dalao.rb', line 5 def name @name end |
Instance Method Details
#==(other) ⇒ Object
11 12 13 |
# File 'lib/dalao.rb', line 11 def ==(other) self.name == other.name end |
#admire ⇒ Object
19 20 21 |
# File 'lib/dalao.rb', line 19 def admire "Wow! #{@name} is too strong!" end |
#eql?(other) ⇒ Boolean
15 16 17 |
# File 'lib/dalao.rb', line 15 def eql?(other) self.name.eql? other.name end |