Class: USTC::Admirable

Inherits:
Object
  • Object
show all
Defined in:
lib/dalao.rb

Direct Known Subclasses

Dalao

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject

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

#admireObject



19
20
21
# File 'lib/dalao.rb', line 19

def admire
  "Wow! #{@name} is too strong!"
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/dalao.rb', line 15

def eql?(other)
  self.name.eql? other.name
end