Class: BattleBoats::NullShip

Inherits:
Object
  • Object
show all
Defined in:
lib/battle_boats/null_ship.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNullShip

Returns a new instance of NullShip.


5
6
7
8
9
# File 'lib/battle_boats/null_ship.rb', line 5

def initialize
  @name = "nothing"
  @length = 1
  @symbol = "X"
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length


3
4
5
# File 'lib/battle_boats/null_ship.rb', line 3

def length
  @length
end

#nameObject (readonly)

Returns the value of attribute name


3
4
5
# File 'lib/battle_boats/null_ship.rb', line 3

def name
  @name
end

#symbolObject (readonly)

Returns the value of attribute symbol


3
4
5
# File 'lib/battle_boats/null_ship.rb', line 3

def symbol
  @symbol
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)

11
12
13
# File 'lib/battle_boats/null_ship.rb', line 11

def empty?
  true
end

#hitObject


15
# File 'lib/battle_boats/null_ship.rb', line 15

def hit; end

#sunk?Boolean

Returns:

  • (Boolean)

17
# File 'lib/battle_boats/null_ship.rb', line 17

def sunk?; end