module Roda::RodaPlugins::ClassMatchers::ClassMethods
def class_matcher(klass, matcher, &block)
if a block is given, it should return an array with the captures to yield to
captures if no block was registered with the class or symbol. In either case,
captures returned by the block for the registered class or symbol, or the regexp
If providing a registered class or symbol, the block will be called with the
If providing a regexp, the block given will be called with all regexp captures.
matcher (if using the symbol_matchers plugin).
The matcher can be a regexp, registered class matcher, or registered symbol
Set the matcher and block to use for the given class.
def class_matcher(klass, matcher, &block) _symbol_class_matcher(Class, klass, matcher, block) do |meth, (_, regexp, convert_meth)| if regexp define_method(meth){consume(regexp, convert_meth)} else define_method(meth){_consume_segment(convert_meth)} end end end
def freeze
def freeze opts[:class_matchers].freeze super end