lib/poolparty/modules/cloud_resourcer.rb
def using(t, &block)
      @cloud = self
      if t && self.class.available_bases.include?(t.to_sym)
        unless using_remoter?
          self.class.send :attr_reader, :remote_base
          self.class.send :attr_reader, :parent_cloud
          klass_string = "#{t}".classify
          klass = "::PoolParty::Remote::#{klass_string}".constantize
          
          @remote_base = klass.send :new, self, &block
          @remote_base.instance_eval &block if block          
          options[:remote_base] = klass.to_s if respond_to?(:options)
          
          @parent_cloud = @cloud
          instance_eval "def #{t};@remote_base;end"
        end
      else
        raise "Unknown remote base: #{t}"
      end
    end
# Declare the remoter base
# Check to make sure the available_bases is available, otherwise raise
# Give access to the cloud the remote_base and instantiate a new
# instance of the remote base
Declare the remoter base
Check to make sure the available_bases is available, otherwise raise
Give access to the cloud the remote_base and instantiate a new
instance of the remote base
Declare the remoter base Check to make sure the available_bases is available otherwise raise Give access to the cloud the remote_base and instantiate a new instance of the remote base
def using(t, &block)
      @cloud = self
      if t && self.class.available_bases.include?(t.to_sym)
        unless using_remoter?
          self.class.send :attr_reader, :remote_base
          self.class.send :attr_reader, :parent_cloud
          klass_string = "#{t}".classify
          klass = "::PoolParty::Remote::#{klass_string}".constantize
          @remote_base = klass.send :new, self, &block
          @remote_base.instance_eval &block if block          
          options[:remote_base] = klass.to_s if respond_to?(:options)
          @parent_cloud = @cloud
          instance_eval "def #{t};@remote_base;end"
        end
      else
        raise "Unknown remote base: #{t}"
      end
    end
def using ( t , & block ) @cloud = self if t && self . class . available_bases . include? ( t . to_sym ) unless using_remoter? self . class . send :attr_reader , :remote_base self . class . send :attr_reader , :parent_cloud klass_string = "#{t}" . classify klass = "::PoolParty::Remote::#{klass_string}" . constantize @remote_base = klass . send :new , self , & block @remote_base . instance_eval & block if block options [ :remote_base ] = klass . to_s if respond_to? ( :options ) @parent_cloud = @cloud instance_eval "def #{t};@remote_base;end" end else raise "Unknown remote base: #{t}" end end
Declare the remoter base
Check to make sure the available_bases is available, otherwise raise
Give access to the cloud the remote_base and instantiate a new
instance of the remote base
Declare the remoter base Check to make sure the available_bases is available otherwise raise Give access to the cloud the remote_base and instantiate a new instance of the remote base
t
block