Class: Tipjoy::Logger
- Inherits:
-
Object
- Object
- Tipjoy::Logger
- Defined in:
- lib/tipjoy.rb
Instance Attribute Summary collapse
-
#on ⇒ Object
Returns the value of attribute on.
Instance Method Summary collapse
- #error(msg) ⇒ Object
- #info(msg) ⇒ Object
-
#initialize(on = false) ⇒ Logger
constructor
A new instance of Logger.
- #on? ⇒ Boolean
- #warn(msg) ⇒ Object
Constructor Details
#initialize(on = false) ⇒ Logger
Returns a new instance of Logger.
19 20 21 |
# File 'lib/tipjoy.rb', line 19 def initialize(on=false) self.on = on end |
Instance Attribute Details
#on ⇒ Object
Returns the value of attribute on.
17 18 19 |
# File 'lib/tipjoy.rb', line 17 def on @on end |
Instance Method Details
#error(msg) ⇒ Object
27 28 29 |
# File 'lib/tipjoy.rb', line 27 def error(msg) info(msg) end |
#info(msg) ⇒ Object
31 32 33 |
# File 'lib/tipjoy.rb', line 31 def info(msg) puts msg if self.on? end |
#on? ⇒ Boolean
35 36 37 |
# File 'lib/tipjoy.rb', line 35 def on? self.on end |
#warn(msg) ⇒ Object
23 24 25 |
# File 'lib/tipjoy.rb', line 23 def warn(msg) info(msg) end |