Class: Brackets::Match
- Inherits:
-
Object
- Object
- Brackets::Match
- Defined in:
- lib/brackets/match.rb
Instance Attribute Summary collapse
-
#blue ⇒ Object
readonly
Returns the value of attribute blue.
-
#deph ⇒ Object
readonly
Returns the value of attribute deph.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#red ⇒ Object
readonly
Returns the value of attribute red.
-
#winner ⇒ Object
readonly
Returns the value of attribute winner.
Instance Method Summary collapse
-
#initialize(deph = 0, number, red, blue) ⇒ Match
constructor
A new instance of Match.
- #name ⇒ Object
- #placeholder? ⇒ Boolean
Constructor Details
#initialize(deph = 0, number, red, blue) ⇒ Match
Returns a new instance of Match.
5 6 7 8 9 |
# File 'lib/brackets/match.rb', line 5 def initialize(deph = 0, number, red, blue) @red, @blue, @deph, @number = red, blue, deph, number @winner = blue.nil? ? red : nil end |
Instance Attribute Details
#blue ⇒ Object (readonly)
Returns the value of attribute blue.
3 4 5 |
# File 'lib/brackets/match.rb', line 3 def blue @blue end |
#deph ⇒ Object (readonly)
Returns the value of attribute deph.
3 4 5 |
# File 'lib/brackets/match.rb', line 3 def deph @deph end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
3 4 5 |
# File 'lib/brackets/match.rb', line 3 def number @number end |
#red ⇒ Object (readonly)
Returns the value of attribute red.
3 4 5 |
# File 'lib/brackets/match.rb', line 3 def red @red end |
#winner ⇒ Object (readonly)
Returns the value of attribute winner.
3 4 5 |
# File 'lib/brackets/match.rb', line 3 def winner @winner end |
Instance Method Details
#name ⇒ Object
15 16 17 |
# File 'lib/brackets/match.rb', line 15 def name "-" end |
#placeholder? ⇒ Boolean
11 12 13 |
# File 'lib/brackets/match.rb', line 11 def placeholder? @red.nil? && @blue.nil? end |