Module: Roda::RodaPlugins::SymbolMatchers::ClassMethods

Defined in:
lib/roda/plugins/symbol_matchers.rb

Instance Method Summary collapse

Instance Method Details

#symbol_matcher(s, re, &block) ⇒ Object

Set the regexp to use for the given symbol, instead of the default.



82
83
84
85
86
87
# File 'lib/roda/plugins/symbol_matchers.rb', line 82

def symbol_matcher(s, re, &block)
  meth = :"match_symbol_#{s}"
  array = [re, block].freeze
  self::RodaRequest.send(:define_method, meth){array}
  self::RodaRequest.send(:private, meth)
end