class ShipBuilder

Attributes

available_blueprints[R]
blueprint[R]

Public Class Methods

new(type = nil) click to toggle source
# File lib/uss-enterprise/ship_builders.rb, line 8
def initialize(type = nil)
  case type
  when nil
    @available_blueprints = Blueprints.new.gimme
  when 'SeaShip'
    @available_blueprints = SeaShipBlueprints.new.gimme
  when 'OrbitalShip'
    @available_blueprints = OrbitalShipBlueprints.new.gimme
  when 'StarShip'
    @available_blueprints = StarShipBlueprints.new.gimme
  end
end

Public Instance Methods

build_it() click to toggle source
# File lib/uss-enterprise/ship_builders.rb, line 25
def build_it
  puts @blueprint
end
define_blueprint(type) click to toggle source
# File lib/uss-enterprise/ship_builders.rb, line 21
def define_blueprint(type)
  @blueprint = @available_blueprints[type]
end