Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/core_ext/object.rb
Instance Method Summary collapse
-
#info(message, color: :black) ⇒ Object
Issue an informational message.
-
#verbose_info(message, color: :blue) ⇒ Object
Issue a verbose informational message.
-
#warn(message, pry:) ⇒ Object
Issue a warning and maybe open a Pry session attached to the error or binding passed.
Instance Method Details
#info(message, color: :black) ⇒ Object
Issue an informational message.
32 33 34 |
# File 'lib/core_ext/object.rb', line 32 def info(, color: :black) puts .send(color) end |
#verbose_info(message, color: :blue) ⇒ Object
Issue a verbose informational message.
39 40 41 |
# File 'lib/core_ext/object.rb', line 39 def verbose_info(, color: :blue) info(, color: color) if $VERBOSE_INFO end |
#warn(message, pry:) ⇒ Object
Issue a warning and maybe open a Pry session attached to the error or binding passed.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/core_ext/object.rb', line 18 def warn(, pry:) $WARN_COUNTER = $WARN_COUNTER.to_i + 1 Kernel.warn "WARNING #{$WARN_COUNTER}: #{}".red if $PRY_ON_WARN == true || $PRY_ON_WARN == $WARN_COUNTER case pry when Exception then Pry::rescued(pry) when Binding then pry.pry end end end |