module CPuts

This module represents the bridge between CPuts functionality and the user

Public Class Methods

override_puts() click to toggle source

Override the usual puts method to always use cputs instead.

# File lib/cputs.rb, line 20
def CPuts.override_puts
    require_relative 'cputs/override.rb'
end
set_preffix(preffix) click to toggle source

Sets the preffix for the output

# File lib/cputs.rb, line 27
def CPuts.set_preffix(preffix)
    CPuts::Functions.preffix preffix
end
set_preffix_and_suffix(*args) click to toggle source

Sets both the preffix and suffix for the output

# File lib/cputs.rb, line 41
def CPuts.set_preffix_and_suffix(*args)
    CPuts::Functions.preffix_and_suffix *args
end
set_suffix(suffix) click to toggle source

Sets the suffix for the output

# File lib/cputs.rb, line 34
def CPuts.set_suffix(suffix)
    CPuts::Functions.suffix suffix
end
set_timestamp(format=nil) click to toggle source

Sets timestamp to be shown in the output. It can be: False to disable it True to enable it String with format, which also enables it

# File lib/cputs.rb, line 51
def CPuts.set_timestamp(format=nil)
    CPuts::Functions.timestamp(format)
end

Public Instance Methods

cputs(message) click to toggle source

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)

# File lib/cputs.rb, line 12
def cputs(message)
    CPuts::Functions.cputs(message, caller)
end