Sha256: 53799d0d8af800fc4feb26315fdea82cffa55a9cea94c784a44a2faf56299c38

Contents?: true

Size: 692 Bytes

Versions: 34

Compression:

Stored size: 692 Bytes

Contents

module Bosh::Stemcell
  module OperatingSystem
    def self.for(operating_system_name)
      case operating_system_name
        when 'centos' then Centos.new
        when 'ubuntu' then Ubuntu.new
        else raise ArgumentError.new("invalid operating system: #{operating_system_name}")
      end
    end

    class Base
      attr_reader :name

      def initialize(options = {})
        @name = options.fetch(:name)
      end

      def ==(other)
        name == other.name
      end
    end

    class Centos < Base
      def initialize
        super(name: 'centos')
      end
    end

    class Ubuntu < Base
      def initialize
        super(name: 'ubuntu')
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
bosh-stemcell-1.2427.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2416.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2411.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2409.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2398.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2384.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2375.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2372.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2366.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2361.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2355.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2354.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2347.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2341.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2334.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2311.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2291.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2200.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2175.0 lib/bosh/stemcell/operating_system.rb
bosh-stemcell-1.2168.0 lib/bosh/stemcell/operating_system.rb