Module: Roda::RodaPlugins::OptimizedStringMatchers::RequestMethods

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

Instance Method Summary collapse

Instance Method Details

#is_exactly(s) ⇒ Object

Optimized version of is that only supports a single string.



35
36
37
38
39
40
41
42
43
44
# File 'lib/roda/plugins/optimized_string_matchers.rb', line 35

def is_exactly(s)
  rp = @remaining_path
  if _match_string(s)
    if @remaining_path.empty?
      always{yield}
    else
      @remaining_path = rp
    end
  end
end

#on_branch(s) ⇒ Object

Optimized version of on that only supports a single string.



30
31
32
# File 'lib/roda/plugins/optimized_string_matchers.rb', line 30

def on_branch(s)
  always{yield} if _match_string(s)
end