Class: RbSnake::Models::Grid

Inherits:
Object
  • Object
show all
Defined in:
lib/rb_snake/models/grid.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rows:, cols:) ⇒ Grid

Returns a new instance of Grid.



8
9
10
11
# File 'lib/rb_snake/models/grid.rb', line 8

def initialize(rows:, cols:)
  @rows = rows
  @cols = cols
end

Instance Attribute Details

#colsObject (readonly)

Returns the value of attribute cols.



6
7
8
# File 'lib/rb_snake/models/grid.rb', line 6

def cols
  @cols
end

#rowsObject (readonly)

Returns the value of attribute rows.



6
7
8
# File 'lib/rb_snake/models/grid.rb', line 6

def rows
  @rows
end