class Robulator::Tabletop
Public Class Methods
new(size)
click to toggle source
# File lib/robulator/tabletop.rb, line 3 def initialize(size) size = Integer(size) @placeable_spots = {x: 0...size, y: 0...size} end
Public Instance Methods
placeable_spot?(x, y)
click to toggle source
# File lib/robulator/tabletop.rb, line 8 def placeable_spot?(x, y) @placeable_spots[:x].include?(Integer(x)) && @placeable_spots[:y].include?(Integer(y)) rescue ArgumentError false end