Module: CPuts
- Defined in:
- lib/cputs.rb,
lib/cputs/override.rb,
lib/cputs/functions.rb
Overview
This module represents the bridge between CPuts functionality and the user
Defined Under Namespace
Class Method Summary collapse
-
.override_puts ⇒ Object
Override the usual puts method to always use cputs instead.
-
.set_preffix(preffix) ⇒ Object
Sets the preffix for the output.
-
.set_preffix_and_suffix(*args) ⇒ Object
Sets both the preffix and suffix for the output.
-
.set_suffix(suffix) ⇒ Object
Sets the suffix for the output.
-
.set_timestamp(format = nil) ⇒ Object
Sets timestamp to be shown in the output.
Instance Method Summary collapse
-
#cputs(message) ⇒ Object
The main method to print (puts) a message with the preffix (if set) File (that’s making the call) Line (of the file) and Suffix (if set) :args: message.
Class Method Details
.override_puts ⇒ Object
Override the usual puts method to always use cputs instead.
20 21 22 |
# File 'lib/cputs.rb', line 20 def CPuts.override_puts require_relative 'cputs/override.rb' end |
.set_preffix(preffix) ⇒ Object
Sets the preffix for the output
27 28 29 |
# File 'lib/cputs.rb', line 27 def CPuts.set_preffix(preffix) CPuts::Functions.preffix preffix end |
.set_preffix_and_suffix(*args) ⇒ Object
Sets both the preffix and suffix for the output
41 42 43 |
# File 'lib/cputs.rb', line 41 def CPuts.set_preffix_and_suffix(*args) CPuts::Functions.preffix_and_suffix *args end |