module Roda::RodaPlugins::AutoForme::ClassMethods

Public Instance Methods

autoforme(opts={}, &block) click to toggle source

Setup AutoForme for the given Roda class using the given options and block. If the :name option is given, store this configuration for the given name.

   # File lib/roda/plugins/autoforme.rb
28 def autoforme(opts={}, &block)
29   @autoforme_routes[opts[:name]] = ::AutoForme.for(:roda, self, opts, &block).route_proc
30 end
autoforme_route(name=nil) click to toggle source

Retrieve the route proc for the named or default AutoForme.

   # File lib/roda/plugins/autoforme.rb
33 def autoforme_route(name=nil)
34   @autoforme_routes[name]
35 end
inherited(subclass) click to toggle source

Copy the autoforme configurations into the subclass.

Calls superclass method
   # File lib/roda/plugins/autoforme.rb
38 def inherited(subclass)
39   super
40   subclass.instance_variable_set(:@autoforme_routes, @autoforme_routes.dup)
41 end