Class: RsCgi
- Inherits:
-
CGI
- Object
- CGI
- RsCgi
- Defined in:
- lib/rscgi.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize ⇒ RsCgi
constructor
A new instance of RsCgi.
Constructor Details
#initialize ⇒ RsCgi
Returns a new instance of RsCgi.
6 7 8 9 10 |
# File 'lib/rscgi.rb', line 6 def initialize query_string = ENV['QUERY_STRING'] || "" @params = URI.decode_www_form(query_string).to_h super end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
17 18 19 |
# File 'lib/rscgi.rb', line 17 def params @params end |
Instance Method Details
#[](key) ⇒ Object
12 13 14 15 |
# File 'lib/rscgi.rb', line 12 def [](key) val = @params[key] Array === val ? val[0] : val.to_s end |