Class: PoolParty::DependencyResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/poolparty/dependency_resolver/dependency_resolver.rb

Direct Known Subclasses

ChefResolver, PuppetResolver

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hsh, contxt = nil) ⇒ DependencyResolver

Returns a new instance of DependencyResolver.



13
14
15
16
17
# File 'lib/poolparty/dependency_resolver/dependency_resolver.rb', line 13

def initialize(hsh, contxt=nil)
  raise DependencyResolverException.new('must pass a hash') if hsh.nil? || !(hsh.instance_of?(OrderedHash) || hsh.instance_of?(Hash))
  @properties_hash = hsh
  @the_cloud = contxt
end

Instance Attribute Details

#properties_hashObject (readonly)

Returns the value of attribute properties_hash.



11
12
13
# File 'lib/poolparty/dependency_resolver/dependency_resolver.rb', line 11

def properties_hash
  @properties_hash
end

#the_cloudObject (readonly)

Returns the value of attribute the_cloud.



11
12
13
# File 'lib/poolparty/dependency_resolver/dependency_resolver.rb', line 11

def the_cloud
  @the_cloud
end

Class Method Details

.compile(hsh, contxt = nil) ⇒ Object



25
26
27
# File 'lib/poolparty/dependency_resolver/dependency_resolver.rb', line 25

def self.compile(hsh, contxt=nil)
  new(hsh, contxt).compile
end

.permitted_resource_options(rules = {}) ⇒ Object



29
30
31
# File 'lib/poolparty/dependency_resolver/dependency_resolver.rb', line 29

def self.permitted_resource_options(rules={})
  @permitted_resource_options ||= rules
end

Instance Method Details

#compileObject

Compile the clouds properties_hash into the format required by the dependency resolver This methods should be overwritten by the supclassed methods



21
22
23
# File 'lib/poolparty/dependency_resolver/dependency_resolver.rb', line 21

def compile()
  raise "Not Implemented"
end

#permitted_resource_optionsObject



33
34
35
# File 'lib/poolparty/dependency_resolver/dependency_resolver.rb', line 33

def permitted_resource_options
  self.class.permitted_resource_options
end

#tf(count) ⇒ Object



37
38
39
# File 'lib/poolparty/dependency_resolver/dependency_resolver.rb', line 37

def tf(count)
  "\t" * count
end