Sha256: a5f17325edb0559eb859c3bf3cbb81f0d753dcb35590de8d644969817641c88e

Contents?: true

Size: 836 Bytes

Versions: 1

Compression:

Stored size: 836 Bytes

Contents

require "make_restful/version"

module MakeRestful
  extend ActiveSupport::Concern
  extend ActiveSupport::Autoload

  autoload :ClassMethods
  autoload :Loaders
  autoload :RestMethods
  autoload :Rendering
  autoload :Callbacks
  autoload :Sugar

  extend  Callbacks
  include Loaders
  include RestMethods
  include Rendering
  include Sugar

  delegate :allow_method?, :allow_format?, to: :klass

  included do

    class_attribute :allowed_methods, :allowed_formats, :finder, :pagination, :resource_class
    attr_reader :resource, :instance, :collection

    resource name.underscore.gsub(/(.*)_controller/,'\1').singularize
    self.allowed_formats = [:json, :jsonp, :xml]
    self.allowed_methods = [:index, :show, :update, :destroy, :create, :spec]
    self.finder = :id

  end

  private

  def klass
    self.class
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
make_restful-0.1.3 lib/make_restful.rb