Class: Tetris::Model::PastGame

Inherits:
Object
  • Object
show all
Defined in:
lib/glimmer-dsl-opal/samples/elaborate/tetris/model/past_game.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#levelObject

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

#linesObject

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

#nameObject

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

#scoreObject

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_aObject



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