module Roda::RodaPlugins::AutoForme::ClassMethods

  1. lib/roda/plugins/autoforme.rb

Methods

Public Instance

  1. autoforme
  2. autoforme_route
  3. inherited

Public Instance methods

autoforme(opts={}, &block)

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.

[show source]
   # 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)

Retrieve the route proc for the named or default AutoForme.

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

Copy the autoforme configurations into the subclass.

[show source]
   # File lib/roda/plugins/autoforme.rb
38 def inherited(subclass)
39   super
40   subclass.instance_variable_set(:@autoforme_routes, @autoforme_routes.dup)
41 end