lib/roda/plugins/params_capturing.rb
# If all arguments are strings or symbols, turn on param capturing during
# the matching, but turn it back off before yielding to the block.  Add
# any captures to the params based on the param capture names added by
# the matchers.
If all arguments are strings or symbols, turn on param capturing during
the matching, but turn it back off before yielding to the block.  Add
any captures to the params based on the param capture names added by
the matchers.
If all arguments are strings or symbols turn on param capturing during the matching but turn it back off before yielding to the block . Add any captures to the params based on the param capture names added by the matchers .
def if_match(args)
          params = self.params
          if args.all?{|x| x.is_a?(String) || x.is_a?(Symbol)}
            pc = @_params_captures = []
          end
          super do |*a|
            if pc
              @_params_captures = nil
              pc.zip(a).each do |k,v|
                params[k] = v
              end
            end
            params['captures'].concat(a) 
            yield(*a)
          end
        end
def if_match ( args ) params = self . params if args . all? { | x | x . is_a? ( String ) || x . is_a? ( Symbol ) } pc = @_params_captures = [ ] end super do | * a | if pc @_params_captures = nil pc . zip ( a ) . each do | k , v | params [ k ] = v end end params [ 'captures' ] . concat ( a ) yield ( * a ) end end
If all arguments are strings or symbols, turn on param capturing during
the matching, but turn it back off before yielding to the block.
If all arguments are strings or symbols turn on param capturing during the matching but turn it back off before yielding to the block .
args