Class: Tetris::Model::PastGame
- Inherits:
-
Object
- Object
- Tetris::Model::PastGame
- Defined in:
- lib/glimmer-dsl-opal/samples/elaborate/tetris/model/past_game.rb
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#name ⇒ Object
Returns the value of attribute name.
-
#score ⇒ Object
Returns the value of attribute score.
Instance Method Summary collapse
-
#initialize(name, score, lines, level) ⇒ PastGame
constructor
A new instance of PastGame.
- #to_a ⇒ Object
Constructor Details
#initialize(name, score, lines, level) ⇒ PastGame
Returns a new instance of PastGame.
27 28 29 30 31 32 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tetris/model/past_game.rb', line 27 def initialize(name, score, lines, level) @name = name @score = score.to_i @lines = lines.to_i @level = level.to_i end |
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
25 26 27 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tetris/model/past_game.rb', line 25 def level @level end |
#lines ⇒ Object
Returns the value of attribute lines.
25 26 27 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tetris/model/past_game.rb', line 25 def lines @lines end |
#name ⇒ Object
Returns the value of attribute name.
25 26 27 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tetris/model/past_game.rb', line 25 def name @name end |
#score ⇒ Object
Returns the value of attribute score.
25 26 27 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tetris/model/past_game.rb', line 25 def score @score end |
Instance Method Details
#to_a ⇒ Object
34 35 36 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tetris/model/past_game.rb', line 34 def to_a [@name, @score, @lines, @level] end |