Class: USTC::Dalao
Instance Attribute Summary
Attributes inherited from Admirable
Instance Method Summary collapse
- #excellent? ⇒ Boolean
- #fail? ⇒ Boolean
-
#initialize(name) ⇒ Dalao
constructor
A new instance of Dalao.
- #to_s ⇒ Object
Methods inherited from Admirable
Constructor Details
#initialize(name) ⇒ Dalao
25 26 27 |
# File 'lib/dalao.rb', line 25 def initialize(name) super(name) end |
Instance Method Details
#excellent? ⇒ Boolean
34 35 36 37 38 39 40 41 |
# File 'lib/dalao.rb', line 34 def excellent? s = self.fail? s ? 'Failed.' : 'Not failed.' rescue TypeError => e e.to_s ensure puts 'Ensure it\'s excellent.' end |
#fail? ⇒ Boolean
29 30 31 32 |
# File 'lib/dalao.rb', line 29 def fail? raise TypeError, "#{@name} can never fail." if @name.downcase == 'zjx' true end |
#to_s ⇒ Object
43 44 45 |
# File 'lib/dalao.rb', line 43 def to_s "#{self.name} is a dalao. " + self.admire end |