Class: MazeMagic::Grid
- Inherits:
-
Object
- Object
- MazeMagic::Grid
- Extended by:
- Forwardable
- Defined in:
- lib/maze_magic/grid.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#start_x ⇒ Object
readonly
Returns the value of attribute start_x.
-
#start_y ⇒ Object
readonly
Returns the value of attribute start_y.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(width:, height:, start_x: 0, start_y: 0) ⇒ Grid
constructor
A new instance of Grid.
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
#height ⇒ Object (readonly)
Returns the value of attribute height.
5 6 7 |
# File 'lib/maze_magic/grid.rb', line 5 def height @height end |
#start_x ⇒ Object (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_y ⇒ Object (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 |
#width ⇒ Object (readonly)
Returns the value of attribute width.
5 6 7 |
# File 'lib/maze_magic/grid.rb', line 5 def width @width end |