Class: MazeMagic::Grid

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/maze_magic/grid.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width:, height:, start_x: 0, start_y: 0) ⇒ Grid

Returns a new instance of Grid.



9
10
11
12
13
14
# File 'lib/maze_magic/grid.rb', line 9

def initialize(width:, height:, start_x: 0, start_y: 0)
  @width  = width
  @height = height
  @start_x = start_x
  @start_y = start_y
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



5
6
7
# File 'lib/maze_magic/grid.rb', line 5

def height
  @height
end

#start_xObject (readonly)

Returns the value of attribute start_x.



5
6
7
# File 'lib/maze_magic/grid.rb', line 5

def start_x
  @start_x
end

#start_yObject (readonly)

Returns the value of attribute start_y.



5
6
7
# File 'lib/maze_magic/grid.rb', line 5

def start_y
  @start_y
end

#widthObject (readonly)

Returns the value of attribute width.



5
6
7
# File 'lib/maze_magic/grid.rb', line 5

def width
  @width
end