Class: Player::Card
Overview
keep Card nested here - why? why not?
Instance Attribute Summary collapse
-
#minute ⇒ Object
readonly
Returns the value of attribute minute.
-
#player ⇒ Object
readonly
Returns the value of attribute player.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#as_json ⇒ Object
only print name and minute for now - why? why not?.
-
#initialize(player:, type:, minute:) ⇒ Card
constructor
A new instance of Card.
Constructor Details
#initialize(player:, type:, minute:) ⇒ Card
Returns a new instance of Card.
26 27 28 29 30 |
# File 'lib/fifadat/models/player.rb', line 26 def initialize( player:, type:, minute: ) @player = player @type = type @minute = minute end |
Instance Attribute Details
#minute ⇒ Object (readonly)
Returns the value of attribute minute.
25 26 27 |
# File 'lib/fifadat/models/player.rb', line 25 def minute @minute end |
#player ⇒ Object (readonly)
Returns the value of attribute player.
25 26 27 |
# File 'lib/fifadat/models/player.rb', line 25 def player @player end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
25 26 27 |
# File 'lib/fifadat/models/player.rb', line 25 def type @type end |
Instance Method Details
#as_json ⇒ Object
only print name and minute for now - why? why not?
33 34 35 36 37 38 39 |
# File 'lib/fifadat/models/player.rb', line 33 def as_json(*) h = { 'name' => player.name, 'minute' => minute } h end |