Sha256: 264a9bc9c7120fa33584dc41f4e9d6bd824acaaf1d93fcfa90834991bbe470b3

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

module Restfulie
  module Client#:nodoc
    module EntryPoint
      include HTTP::RequestMarshaller
      include HTTP::RequestFollow
      extend self

      def self.at(uri)
        Object.new.send(:extend, EntryPoint).at(uri)
      end

      def recipe(converter_sym, options={}, &block)
        raise 'Undefined block' unless block_given?
        converter = "Restfulie::Common::Converter::#{converter_sym.to_s.camelize}".constantize
        converter.describe_recipe(options[:name], &block) 
      end

      @resources_configurations = {}
      def configuration_of(resource_name)
        @resources_configurations[resource_name]
      end

      def configuration_for(resource_name,configuration = Configuration.new)
        yield configuration if block_given?
        @resources_configurations[resource_name] = configuration
      end

      def retrieve(resource_name)
        returning Object.new do |resource| 
          resource.extend(Base)
          resource.configure
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
restfulie-0.9.3 lib/restfulie/client/entry_point.rb
restfulie-0.9.1 lib/restfulie/client/entry_point.rb
restfulie-0.8.1 lib/restfulie/client/entry_point.rb