Class: PoolParty::DslBase

Inherits:
Base show all
Defined in:
lib/poolparty/dsl_base.rb

Direct Known Subclasses

Cloud, Pool

Instance Attribute Summary

Attributes inherited from Base

#base_name, #init_opts

Instance Method Summary collapse

Methods inherited from Base

#add_ordered_resources_to_result, #after_loaded, #all_resources, #before_load, clouds_dot_rb_dir, #clouds_dot_rb_dir, #clouds_dot_rb_file, clouds_dot_rb_file, #compile_opts, #create_graph, #dependencies, #get_resource, #has_searchable_paths, #initialize, #method_missing, #ordered_resources, #output_resources_graph, #resources, #resources_graph, #resources_with_dependencies, #resources_without_dependencies, #run_in_context, #run_with_callbacks, #to_s, #valid?, #validations

Methods included from Delayed

included

Methods included from Callbacks

included

Methods included from SearchablePaths

included

Constructor Details

This class inherits a constructor from PoolParty::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PoolParty::Base

Instance Method Details

#instances(arg) ⇒ Object

Set instances with a range or a number if passed with a hash, call nodes(hash) to return filtered list of instances



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/poolparty/dsl_base.rb', line 20

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