Sha256: 330b6601b880ec3f183936825597e3cd22b0c9e3fb01086e252135e3c9bf4df0

Contents?: true

Size: 954 Bytes

Versions: 28

Compression:

Stored size: 954 Bytes

Contents

=begin rdoc
  Dsl Base class for all cloud dsl methods
  
  Pool and Cloud both are taken from the DslBase so that both
  carry the same dsl. The methods that apply to either/or
  are defined in the respective classes
=end

module PoolParty
  class DslBase < Base
    
    default_options(
      :minimum_instances        => 2,
      :maximum_instances        => 5
    )
            
    # Set instances with a range or a number
    # if passed with a hash, call nodes(hash) to return filtered list of 
    # instances
    def instances(arg)
      case arg
      when Range
        minimum_instances arg.first
        maximum_instances arg.last
      when Fixnum
        minimum_instances arg
        maximum_instances arg
      when Hash
        nodes(arg)
      else
        raise PoolParty::PoolPartyError.create("DslMethodCall", "You must call instances with either a number, a range or a hash (for a list of nodes)")
      end
    end
    
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
auser-poolparty-1.3.0 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.1 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.10 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.11 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.12 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.13 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.14 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.15 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.16 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.17 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.2 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.3 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.4 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.5 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.6 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.7 lib/poolparty/dsl_base.rb
auser-poolparty-1.3.8 lib/poolparty/dsl_base.rb
fairchild-poolparty-1.3.17 lib/poolparty/dsl_base.rb
fairchild-poolparty-1.3.5 lib/poolparty/dsl_base.rb
poolparty-1.3.15 lib/poolparty/dsl_base.rb