Class: PoolParty::Resources::CustomResource

Inherits:
Resource show all
Defined in:
lib/poolparty/pool/custom_resource.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#absent, available_resource_methods, available_resources, #class_type_name, custom_function, #custom_function, custom_functions, custom_functions_to_string, #disallowed_options, #ensures, #get_modified_options, #ifnot, #is_absent, #is_present, #key, #loaded, #present, #requires, #template, #virtual_resource?

Methods included from PoolParty::Resources

add_has_and_does_not_have_methods_for, #add_resource, #call_function, #classpackage_with_self, #custom_file, custom_function, #custom_function, #gem, #get_resource, #reset_resources!, #resource, #resources, #resources_string, #resources_string_from_resources

Methods included from Configurable

included

Methods included from CloudResourcer

#full_keypair_path, #instances, #keypair_path, #keypair_paths, #new_keypair_path, #number_of_resources, #parent, #possible_keypair_basenames, #set_parent

Constructor Details

#initialize(name = :custom_method, opts = {}, &block) ⇒ CustomResource

Returns a new instance of CustomResource.



35
36
37
38
# File 'lib/poolparty/pool/custom_resource.rb', line 35

def initialize(name=:custom_method, opts={}, &block)
  @name = name
  super(opts, &block)
end

Class Method Details

.inherited(subclass) ⇒ Object



40
41
42
43
# File 'lib/poolparty/pool/custom_resource.rb', line 40

def self.inherited(subclass)
  PoolParty::Resources.available_custom_resources << subclass
  super(subclass)
end

Instance Method Details

#to_string(prev = "") ⇒ Object



45
46
47
48
49
50
# File 'lib/poolparty/pool/custom_resource.rb', line 45

def to_string(prev="")
  returning Array.new do |output|
    output << "#{prev} # Custom Functions\n"
    output << self.class.custom_functions_to_string(prev)
  end.join("\n")        
end