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, line 27
def autoforme(opts={}, &block)
  @autoforme_routes[opts[:name]] = ::AutoForme.for(:roda, self, opts, &block).route_proc
end
autoforme_route (name=nil)

Retrieve the route proc for the named or default AutoForme.

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

Copy the autoforme configurations into the subclass.

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