Class: Rubyquest::Hero
- Inherits:
-
Object
- Object
- Rubyquest::Hero
- Defined in:
- lib/rubyquest/hero.rb
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#map ⇒ Object
readonly
Returns the value of attribute map.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
-
.find(name) ⇒ Object
Latter it will find the user from some place.
Instance Method Summary collapse
-
#initialize(name) ⇒ Hero
constructor
A new instance of Hero.
Constructor Details
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level.
6 7 8 |
# File 'lib/rubyquest/hero.rb', line 6 def level @level end |
#map ⇒ Object (readonly)
Returns the value of attribute map.
6 7 8 |
# File 'lib/rubyquest/hero.rb', line 6 def map @map end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/rubyquest/hero.rb', line 6 def name @name end |
Class Method Details
.find(name) ⇒ Object
Latter it will find the user from some place
15 16 17 18 19 20 21 22 |
# File 'lib/rubyquest/hero.rb', line 15 def self.find(name) name.strip! if !name.empty? new(name) else nil end end |