Sha256: a09c16104e5076af819f4bdf8c7d36387b6741a863da40b3c38a0610fba9c49e

Contents?: true

Size: 802 Bytes

Versions: 6

Compression:

Stored size: 802 Bytes

Contents

=begin rdoc
  Cloud extensions for the DependencyResolver
=end

module PoolParty
  # Take the cloud dependency tree
  module DependencyResolverCloudExtensions    
    def to_properties_hash
      oh = OrderedHash.new
      oh[:options] = options.merge(:cloud_name => name)
      oh[:resources] = resources.keys.inject(OrderedHash.new) do |sum,k|
        sum.merge(k.to_sym => resources[k].map {|a| a.to_properties_hash } )
      end
      oh[:services] = services.keys.inject(OrderedHash.new) do |sum,k|
        sum.merge(k.to_sym => services[k].map {|a| a.to_properties_hash } )
      end
      oh
    end
    
  end
  
  # Adds the to_properties_hash method on top of resources, the lowest level
  module DependencyResolverResourceExtensions
    def to_properties_hash
      options
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
auser-poolparty-1.1.1 lib/poolparty/dependency_resolver/dependency_resolver_cloud_extensions.rb
auser-poolparty-1.1.3 lib/poolparty/dependency_resolver/dependency_resolver_cloud_extensions.rb
auser-poolparty-1.1.4 lib/poolparty/dependency_resolver/dependency_resolver_cloud_extensions.rb
auser-poolparty-1.1.5 lib/poolparty/dependency_resolver/dependency_resolver_cloud_extensions.rb
fairchild-poolparty-1.1.3 lib/poolparty/dependency_resolver/dependency_resolver_cloud_extensions.rb
fairchild-poolparty-1.1.4 lib/poolparty/dependency_resolver/dependency_resolver_cloud_extensions.rb