Created
February 5, 2014 14:58
-
-
Save tanraya/8825447 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
module Papillon::Controller | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# TODO Write specs this | |
mattr_accessor :papillon_dsl, :papillon_resource, :papillon_controller_builder | |
def papillon(resource_class, options = {}, &block) | |
self.papillon_dsl ||= Papillon::Dsl.new(options, &block) | |
self.papillon_resource ||= Papillon::Resource.new(resource_class, options) | |
self.papillon_controller_builder ||= Papillon::ControllerBuilder.new( | |
self, papillon_resource, papillon_dsl | |
) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment