class Battleships::Cell
Attributes
content[RW]
Public Instance Methods
empty?()
click to toggle source
# File lib/battleships/cell.rb, line 14 def empty? !content end
receive_shot()
click to toggle source
# File lib/battleships/cell.rb, line 5 def receive_shot @shot = true content.hit unless empty? end
shot?()
click to toggle source
# File lib/battleships/cell.rb, line 10 def shot? @shot end
status()
click to toggle source
# File lib/battleships/cell.rb, line 18 def status if shot? return empty? ? :miss : :hit end :none end