module Roda::RodaPlugins::IntegerMatcherMax
The Integer_matcher_max plugin sets the maximum integer value value that the Integer class matcher will match by default. By default, loading this plugin sets the maximum value to 2**63-1, the largest signed 64-bit integer value:
plugin :Integer_matcher_max route do |r| r.is Integer do # Matches /9223372036854775807 # Does not match /9223372036854775808 end end
To specify a different maximum value, you can pass a different maximum value when loading the plugin:
plugin :Integer_matcher_max, 2**64-1
Public Class Methods
Source
# File lib/roda/plugins/Integer_matcher_max.rb, line 24 def self.configure(app, max=nil) if max app.class_eval do meth = :_max_value_convert_class_Integer define_method(meth){max} alias_method meth, meth private meth end end end