Class: MmunicodeRails::RackMmunicode
- Inherits:
-
Object
- Object
- MmunicodeRails::RackMmunicode
- Includes:
- Core
- Defined in:
- lib/mmunicode_rails.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ RackMmunicode
constructor
A new instance of RackMmunicode.
Methods included from Core
#detect_font, #uni512zg1, #zg12uni51
Constructor Details
#initialize(app) ⇒ RackMmunicode
Returns a new instance of RackMmunicode.
289 290 291 |
# File 'lib/mmunicode_rails.rb', line 289 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/mmunicode_rails.rb', line 294 def call(env) request = Rack::Request.new env #This monkey patching is a hack for rack 1.4.5 compatibility required for rails 3.2.* unless request.respond_to? :update_param then request.instance_eval do def update_param(k, v) found = false if self.GET.has_key?(k) found = true self.GET[k] = v end if self.POST.has_key?(k) found = true self.POST[k] = v end unless found self.GET[k] = v end @params = nil nil end end end converted_params = [] request.params.each_pair do|key,value| puts "#{key}: #{value}" end converted_params = nested_param_traversal(request.params) converted_params.each_pair do|key,value| puts "#{key}: #{value}" request.params[key] = value end @app.call(env) end |