Parent

Methods

Rack::NestedParams::UrlEncodedPairParser

Attributes

parent[R]
result[R]
top[R]

Public Class Methods

new(pairs = []) click to toggle source
# File lib/rack/contrib/nested_params.rb, line 52
def initialize(pairs = [])
  super('')
  @result = {}
  pairs.each { |key, value| parse(key, value) }
end

Public Instance Methods

parse(key, value) click to toggle source

Parse the query string

# File lib/rack/contrib/nested_params.rb, line 62
def parse(key, value)
  self.string = key
  @top, @parent = result, nil

  # First scan the bare key
  key = scan(KEY_REGEXP) or return
  key = post_key_check(key)

  # Then scan as many nestings as present
  until eos?
    r = scan(BRACKETED_KEY_REGEXP) or return
    key = self[1]
    key = post_key_check(key)
  end

  bind(key, value)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.