# class WebConsole::WhinyRequest

Noisy wrapper around `Request`.

If any calls to `from_whitelisted_ip?` and `acceptable_content_type?` return false, an info log message will be displayed in users' logs.

### Public Instance Methods

from_whitelisted_ip?() click to toggle source

    # File lib/web_console/whiny_request.rb, line 7
    def from_whitelisted_ip?
      whine_unless request.from_whitelisted_ip? do
        "Cannot render console from #{request.strict_remote_ip}! "            "Allowed networks: #{request.whitelisted_ips}"
      end
    end

### Private Instance Methods

logger() click to toggle source

    # File lib/web_console/whiny_request.rb, line 23
    def logger
      env['action_dispatch.logger'] || WebConsole.logger
    end

request() click to toggle source

    # File lib/web_console/whiny_request.rb, line 27
    def request
      __getobj__
    end

whine_unless(condition) { || ... } click to toggle source

    # File lib/web_console/whiny_request.rb, line 16
    def whine_unless(condition)
      unless condition
        logger.info { yield }
      end
      condition
    end