watson-ruby icon indicating copy to clipboard operation
watson-ruby copied to clipboard

Not sure if module_function is proper way to scope [lib/watson.rb]

Open nhmood opened this issue 11 years ago • 0 comments

filename : lib/watson.rb line # : 36 tag : review md5 : 689efffa625cb16851d04b12478c5cc4

# [review] - Not sure if module_function is proper way to scope
# I want to be able to call debug_print without having to use the scope
# operator (Watson::Printer.debug_print) so it is defined here as a 
# module_function instead of having it in the Printer class
# Gets included into every class individually
module_function

###########################################################
# Global debug print that prints based on local file DEBUG flag as well as GLOBAL debug flag 
def debug_print(msg)
# [todo] - If input msg is a Hash, use pp to dump it
        # Print only if DEBUG flag of calling class is true OR 
    # GLOBAL_DEBUG_ON of Watson module (defined above) is true
    # AND GLOBAL_DEBUG_OFF of Watson module (Defined above) is false
        # Sometimes we call debug_print from a static method (class << self)

nhmood avatar Nov 21 '13 16:11 nhmood