Class: PoolParty::Resources::Variable

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

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, inherited, #initialize, #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

This class inherits a constructor from PoolParty::Resources::Resource

Instance Method Details

#to_string(prev = "\t") ⇒ Object



11
12
13
# File 'lib/poolparty/pool/resources/variable.rb', line 11

def to_string(prev="\t")
  "$#{name} = #{value_string}"
end

#value_string ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/poolparty/pool/resources/variable.rb', line 15

def value_string
  case value.class.to_s
  when "Array"
    "[ #{value.map{|a| "'#{a}'"}.join(", ")} ]"
  else
    "'#{value}'"
  end
end