Class: ChromeLogger
- Inherits:
-
Object
- Object
- ChromeLogger
- Defined in:
- lib/chrome_logger.rb,
lib/chrome_logger/console.rb,
lib/chrome_logger/railtie.rb,
lib/chrome_logger/version.rb,
lib/chrome_logger/serializer.rb
Defined Under Namespace
Classes: Console, Railtie, Serializer
Constant Summary collapse
- DEFAULT_ENV_NAME =
'console'
- HEADER =
'X-ChromeLogger-Data'
- VERSION =
"0.1.2"
Class Attribute Summary collapse
-
.env_name ⇒ Object
Returns the value of attribute env_name.
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
- #call(env) ⇒ Object
- #env_name ⇒ Object
-
#initialize(app) ⇒ ChromeLogger
constructor
A new instance of ChromeLogger.
Constructor Details
#initialize(app) ⇒ ChromeLogger
Returns a new instance of ChromeLogger.
16 17 18 |
# File 'lib/chrome_logger.rb', line 16 def initialize( app ) @app = app end |
Class Attribute Details
.env_name ⇒ Object
Returns the value of attribute env_name.
12 13 14 |
# File 'lib/chrome_logger.rb', line 12 def env_name @env_name end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
6 7 8 |
# File 'lib/chrome_logger.rb', line 6 def app @app end |
Instance Method Details
#call(env) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/chrome_logger.rb', line 20 def call( env ) env[ env_name ] = Console.new status , headers , response = app.call env headers[ HEADER ] = Serializer.serialize env[ env_name ] [ status , headers , response ] end |
#env_name ⇒ Object
27 28 29 |
# File 'lib/chrome_logger.rb', line 27 def env_name self.class.env_name end |