Top Level Namespace

Defined Under Namespace

Modules: Rudeki Classes: StandardError

Instance Method Summary collapse

Instance Method Details

#p(arg) ⇒ Object



44
45
46
47
48
49
50
51
52
53
# File 'lib/rudeki.rb', line 44

def p(arg)
  if Rudeki::Config.methods.include?(:p)
    rudeki_info "╔═════════ METHOD - P ═════"
    rudeki_info " p -> #{caller.first.to_s}"
    rudeki_info arg
    rudeki_info "╚═════════════════════════════"
  else
    rudeki_info arg
  end
end

#puts(arg) ⇒ Object



33
34
35
36
37
38
39
40
41
42
# File 'lib/rudeki.rb', line 33

def puts(arg)
  if Rudeki::Config.methods.include?(:puts)
    rudeki_info "╔═════════ METHOD - PUTS ═════"
    rudeki_info " puts -> #{caller.first.to_s}"
    rudeki_info arg
    rudeki_info "╚═════════════════════════════"
  else
    rudeki_info arg
  end
end

#rudeki_info(message) ⇒ Object

Kernel.puts



7
8
9
10
11
12
13
# File 'lib/rudeki.rb', line 7

def rudeki_info(message)
  if @logger.nil?
    @logger = Logger.new(Rudeki::Config.logdev || STDOUT)
    @logger.formatter = proc { |severity, datetime, progname, msg|  "#{msg}\n" }
  end
  @logger.info(message)
end