Sha256: 452851c57f472c27ee20caceff4186f7844a39387a85b5a48d0b507f8637d041

Contents?: true

Size: 835 Bytes

Versions: 3

Compression:

Stored size: 835 Bytes

Contents

module Restfulie
  module Client#:nodoc
    module Base
      include HTTP::RequestMarshaller
     
      def self.included(base)#:nodoc
        base.extend(self)
      end
  
      def uses_restfulie(configuration = Configuration.new,&block)
        EntryPoint.configuration_for(resource_name,configuration,&block)
        configure
      end
  
      def configure
        configuration = EntryPoint.configuration_of(resource_name)
        raise "Undefined configuration for #{resource_name}" unless configuration
        at(configuration.entry_point)
        configuration.representations.each do |representation_name,representation|
          register_representation(representation_name,representation)
        end
      end
  
      def resource_name
        @resource_name ||= self.class.to_s.to_sym 
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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