Sha256: 605ebd3037222fc5b6eb9a282e109b89ef80fca8fc8fdcace83f4ca5c7b035bb

Contents?: true

Size: 556 Bytes

Versions: 1

Compression:

Stored size: 556 Bytes

Contents

module Rack::PerftoolsProfiler

  class ProfileDataAction < Action
    
    def check_printer_arg
      request = Rack::Request.new(@env)
      printer = request.GET['printer']
      self.class.check_printer(printer, @env)
    end

    def self.check_printer(printer, env=nil)
      if printer != nil && !ProfilerMiddleware::PRINTERS.member?(printer.to_sym)
        message = "Invalid printer type: #{printer}. Valid printer values are #{ProfilerMiddleware::PRINTERS.join(", ")}" 
        raise ProfilerArgumentError, message
      end
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-perftools_profiler-0.4.1 lib/rack/perftools_profiler/profile_data_action.rb