Class: BStats::Winner
- Inherits:
-
Object
- Object
- BStats::Winner
- Defined in:
- lib/bstats/winner.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#player ⇒ Object
Returns the value of attribute player.
Instance Method Summary collapse
- #awarded? ⇒ Boolean
-
#initialize ⇒ Winner
constructor
A new instance of Winner.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Winner
Returns a new instance of Winner.
5 6 7 |
# File 'lib/bstats/winner.rb', line 5 def initialize @player = nil end |
Instance Attribute Details
#player ⇒ Object
Returns the value of attribute player.
3 4 5 |
# File 'lib/bstats/winner.rb', line 3 def player @player end |
Instance Method Details
#awarded? ⇒ Boolean
9 10 11 |
# File 'lib/bstats/winner.rb', line 9 def awarded? [nil, ""].include?(@player) ? false : true end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/bstats/winner.rb', line 13 def to_s awarded? ? "#{@player.last_name}, #{@player.first_name}" : "No winner." end |