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
isthat only supports a single string. -
#on_branch(s) ⇒ Object
Optimized version of
onthat only supports a single string.
Instance Method Details
#is_exactly(s) ⇒ Object
Optimized version of is that only supports a single string.
39 40 41 42 43 44 45 46 47 |
# File 'lib/roda/plugins/optimized_string_matchers.rb', line 39 def is_exactly(s) rp = @remaining_path if _match_string(s) if @remaining_path.empty? always{yield} end @remaining_path = rp end end |
#on_branch(s) ⇒ Object
Optimized version of on that only supports a single string.
30 31 32 33 34 35 36 |
# File 'lib/roda/plugins/optimized_string_matchers.rb', line 30 def on_branch(s) rp = @remaining_path if _match_string(s) always{yield} @remaining_path = rp end end |