Parent

Class Index [+]

Quicksearch

Rack::Utils::KeySpaceConstrainedParams

Public Class Methods

new(limit = Utils.key_space_limit) click to toggle source
     # File lib/rack/utils.rb, line 434
434:       def initialize(limit = Utils.key_space_limit)
435:         @limit  = limit
436:         @size   = 0
437:         @params = {}
438:       end

Public Instance Methods

[](key) click to toggle source
     # File lib/rack/utils.rb, line 440
440:       def [](key)
441:         @params[key]
442:       end
[]=(key, value) click to toggle source
     # File lib/rack/utils.rb, line 444
444:       def []=(key, value)
445:         @size += key.size unless @params.key?(key)
446:         raise RangeError, 'exceeded available parameter key space' if @size > @limit
447:         @params[key] = value
448:       end
key?(key) click to toggle source
     # File lib/rack/utils.rb, line 450
450:       def key?(key)
451:         @params.key?(key)
452:       end
to_params_hash() click to toggle source
     # File lib/rack/utils.rb, line 454
454:       def to_params_hash
455:         hash = @params
456:         hash.keys.each do |key|
457:           value = hash[key]
458:           if value.kind_of?(self.class)
459:             hash[key] = value.to_params_hash
460:           elsif value.kind_of?(Array)
461:             value.map! {|x| x.kind_of?(self.class) ? x.to_params_hash : x}
462:           end
463:         end
464:         hash
465:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.