Sha256: fbeb311aaad513853c1c0041cc7fc347eb5ca42141dae24ff3b845e41d915a27

Contents?: true

Size: 512 Bytes

Versions: 2

Compression:

Stored size: 512 Bytes

Contents

module Landrush
  class Config < Vagrant.plugin('2', :config)
    attr_accessor :hosts

    def initialize
      @hosts = {}
      @enabled = false
    end

    def enable(enabled=true)
      @enabled = true
    end

    def disable
      @enabled = false
    end

    def enabled?
      @enabled
    end

    def host(hostname, ip_address)
      @hosts[hostname] = ip_address
    end

    def merge(other)
      super.tap do |result|
        result.hosts = @hosts.merge(other.hosts)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
landrush-0.3.1 lib/landrush/config.rb
landrush-0.3.0 lib/landrush/config.rb