Class: Board
- Inherits:
-
Object
- Object
- Board
- Defined in:
- lib/my_own_maze/model/board.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#points ⇒ Object
Returns the value of attribute points.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #find_point(x, y) ⇒ Object
-
#initialize(points, width, height) ⇒ Board
constructor
A new instance of Board.
Constructor Details
#initialize(points, width, height) ⇒ Board
Returns a new instance of Board.
4 5 6 7 8 |
# File 'lib/my_own_maze/model/board.rb', line 4 def initialize(points, width, height) @points = points @width = width @height = height end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
2 3 4 |
# File 'lib/my_own_maze/model/board.rb', line 2 def height @height end |
#points ⇒ Object
Returns the value of attribute points.
2 3 4 |
# File 'lib/my_own_maze/model/board.rb', line 2 def points @points end |
#width ⇒ Object
Returns the value of attribute width.
2 3 4 |
# File 'lib/my_own_maze/model/board.rb', line 2 def width @width end |
Instance Method Details
#find_point(x, y) ⇒ Object
10 11 12 |
# File 'lib/my_own_maze/model/board.rb', line 10 def find_point(x, y) @points.find { |point| point.x == x && point.y == y } end |