Class: Podio::StdoutLogger
- Inherits:
-
Object
- Object
- Podio::StdoutLogger
- Defined in:
- lib/podio.rb
Instance Method Summary collapse
-
#initialize(debug) ⇒ StdoutLogger
constructor
A new instance of StdoutLogger.
- #log(env) ⇒ Object
Constructor Details
#initialize(debug) ⇒ StdoutLogger
Returns a new instance of StdoutLogger.
43 44 45 |
# File 'lib/podio.rb', line 43 def initialize(debug) @debug = debug end |
Instance Method Details
#log(env) ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/podio.rb', line 47 def log(env) begin puts "\n==> #{env[:method].to_s.upcase} #{env[:url]} \n\n" if @debug yield ensure puts "\n== (#{env[:status]}) ==> #{env[:body]}\n\n" if @debug end end |