Sha256: 0d08eacef4c7a863893acd847edd09ea014eabccb8ed4ece2e68b3af2f3d9ab9

Contents?: true

Size: 563 Bytes

Versions: 4

Compression:

Stored size: 563 Bytes

Contents

class MachineGroup
  
  def initialize(name, options={}) #:nodoc
    @name = name
    @options = options
  end
  
  def base(&block) #:nodoc
    @base_machine = Machine.new(@name, @options, block)
    Machine.machines[@name] = @base_machine
  end
  
  def define(name, &block) #:nodoc
    if @base_machine
      options = @options.merge(:extends => @name)
    else
      options = @options.merge(:class => (@options[:class] || @name.to_s.camelize.constantize))
    end
    machine = Machine.new(name, options, block)
    Machine.machines[name] = machine
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
aub-machine-1.0.0 lib/machine/machine_group.rb
aub-machine-1.0.1 lib/machine/machine_group.rb
aub-machine-1.0.2 lib/machine/machine_group.rb
aub-machine-1.0.3 lib/machine/machine_group.rb