Sha256: 616310fa022f928f802b95d5d64b497e6763f9dbe69a68a629f8483e7cb3d9b4

Contents?: true

Size: 536 Bytes

Versions: 2

Compression:

Stored size: 536 Bytes

Contents

require 'ostruct'
require 'forwardable'
require 'exogenesis/support/spacesuit'

class Ship
  extend Forwardable

  def initialize(raw_config)
    config = OpenStruct.new(raw_config)
    @package_managers = []
    config.passengers.each do |passenger_name|
      passenger = Passenger.by_name(passenger_name).new(config)
      @package_managers << Spacesuit.new(passenger)
    end
  end

  def_delegator :@package_managers, :each

  def clean
    each(&:clean)
  end

  def up
    each(&:up)
  end

  def down
    each(&:down)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
exogenesis-1.0.0 lib/exogenesis/support/ship.rb
exogenesis-0.2.0 lib/exogenesis/support/ship.rb