Module: Roda::RodaPlugins::OptimizedStringMatchers::RequestMethods
- Defined in:
- lib/roda/plugins/optimized_string_matchers.rb
Instance Method Summary collapse
-
#is_exactly(s) ⇒ Object
Optimized version of
is
that only supports a single string. -
#on_branch(s) ⇒ Object
Optimized version of
on
that only supports a single string.
Instance Method Details
#is_exactly(s) ⇒ Object
Optimized version of is
that only supports a single string.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/roda/plugins/optimized_string_matchers.rb', line 36 def is_exactly(s) rp = @remaining_path if _match_string(s) if @remaining_path == EMPTY_STRING always{yield} else @remaining_path = rp end end end |
#on_branch(s) ⇒ Object
Optimized version of on
that only supports a single string.
31 32 33 |
# File 'lib/roda/plugins/optimized_string_matchers.rb', line 31 def on_branch(s) always{yield} if _match_string(s) end |