Class: Rack::App::Params

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/app/params.rb

Constant Summary collapse

E =
::Rack::App::Constants::ENV

Instance Method Summary collapse

Instance Method Details

#merged_paramsObject



11
12
13
# File 'lib/rack/app/params.rb', line 11

def merged_params
  @env[E::MERGED_PARAMS] ||= query_string_params.merge(path_segments_params)
end

#path_segments_paramsObject



19
20
21
# File 'lib/rack/app/params.rb', line 19

def path_segments_params
  @env[E::PATH_SEGMENTS_PARAMS]
end

#query_string_paramsObject



15
16
17
# File 'lib/rack/app/params.rb', line 15

def query_string_params
  @env[E::QUERY_STRING_PARAMS] ||= generate_query_params
end

#to_hashObject



7
8
9
# File 'lib/rack/app/params.rb', line 7

def to_hash
  validated_params || merged_params
end

#validated_paramsObject



23
24
25
# File 'lib/rack/app/params.rb', line 23

def validated_params
  @env[E::VALIDATED_PARAMS]
end