Module: Roda::RodaPlugins::Monads::ClassMethods
- Defined in:
- lib/roda/plugins/monads.rb
Overview
Extends ‘Roda` class interface with #either_matcher method
Instance Method Summary collapse
Instance Method Details
#either_matcher(name = :either, aliases: [], &matcher) ⇒ Proc
60 61 62 63 64 65 |
# File 'lib/roda/plugins/monads.rb', line 60 def either_matcher(name = :either, aliases: [], &matcher) @matchers ||= {} @matchers[name] = matcher if block_given? aliases.each { |alt| @matchers[alt] = @matchers[name] } @matchers[name] end |