Class: GG::Logger
Instance Attribute Summary collapse
-
#console_array ⇒ Object
readonly
Returns the value of attribute console_array.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#html_array ⇒ Object
readonly
Returns the value of attribute html_array.
-
#response ⇒ Object
Returns the value of attribute response.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#<<(html) ⇒ Object
Adds the given HTML to the HTML array storing all logging information.
- #empty? ⇒ Boolean
-
#html ⇒ Object
Returns a String that represent all the HTML sent to the logger via #<<.
-
#initialize(env) ⇒ Logger
constructor
A new instance of Logger.
- #request ⇒ Object
Constructor Details
#initialize(env) ⇒ Logger
Returns a new instance of Logger.
7 8 9 10 11 12 13 |
# File 'lib/gg/logger.rb', line 7 def initialize( env ) @env = env @time = Time.now @html_array = [] @console_array = [] @is_empty = true end |
Instance Attribute Details
#console_array ⇒ Object (readonly)
Returns the value of attribute console_array.
15 16 17 |
# File 'lib/gg/logger.rb', line 15 def console_array @console_array end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
15 16 17 |
# File 'lib/gg/logger.rb', line 15 def env @env end |
#html_array ⇒ Object (readonly)
Returns the value of attribute html_array.
15 16 17 |
# File 'lib/gg/logger.rb', line 15 def html_array @html_array end |
#response ⇒ Object
Returns the value of attribute response.
16 17 18 |
# File 'lib/gg/logger.rb', line 16 def response @response end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
15 16 17 |
# File 'lib/gg/logger.rb', line 15 def time @time end |
Instance Method Details
#<<(html) ⇒ Object
Adds the given HTML to the HTML array storing all logging information
27 28 29 30 |
# File 'lib/gg/logger.rb', line 27 def <<( html ) @is_empty = false html_array << html end |
#empty? ⇒ Boolean
37 38 39 |
# File 'lib/gg/logger.rb', line 37 def empty? @is_empty end |
#html ⇒ Object
Returns a String that represent all the HTML sent to the logger via #<<
33 34 35 |
# File 'lib/gg/logger.rb', line 33 def html html_array.join end |
#request ⇒ Object
18 19 20 |
# File 'lib/gg/logger.rb', line 18 def request Rack::Request.new( env ) end |