Class: Penalty
- Inherits:
-
Object
- Object
- Penalty
- Defined in:
- lib/fbtxt-pp/models/penalties.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#scored ⇒ Object
readonly
Returns the value of attribute scored.
-
#team ⇒ Object
readonly
Returns the value of attribute team.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, scored:, score:, team:) ⇒ Penalty
constructor
A new instance of Penalty.
- #scored? ⇒ Boolean
Constructor Details
#initialize(name:, scored:, score:, team:) ⇒ Penalty
Returns a new instance of Penalty.
17 18 19 20 21 22 23 24 25 |
# File 'lib/fbtxt-pp/models/penalties.rb', line 17 def initialize( name:, scored:, score:, team: ) @name = name @scored = scored @score = score ## maybe allow empty score - why? why not? @team = team end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/fbtxt-pp/models/penalties.rb', line 14 def name @name end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
14 15 16 |
# File 'lib/fbtxt-pp/models/penalties.rb', line 14 def score @score end |
#scored ⇒ Object (readonly)
Returns the value of attribute scored.
14 15 16 |
# File 'lib/fbtxt-pp/models/penalties.rb', line 14 def scored @scored end |
#team ⇒ Object (readonly)
Returns the value of attribute team.
14 15 16 |
# File 'lib/fbtxt-pp/models/penalties.rb', line 14 def team @team end |
Class Method Details
.build(h) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/fbtxt-pp/models/penalties.rb', line 4 def self.build( h ) new( name: h['name'], scored: h['scored'], ## true|false for now only score: h['score'], team: h['team'] ## 1|2 ) end |
Instance Method Details
#scored? ⇒ Boolean
27 |
# File 'lib/fbtxt-pp/models/penalties.rb', line 27 def scored?() @scored; end |