Module: ImwUx

Included in:
InstanceMethodWrapper, InstanceMethodWrapper
Defined in:
lib/instance_method_wrapper.rb

Instance Method Summary collapse

Instance Method Details

#imw_indent(dir = :in, inst = true) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/instance_method_wrapper.rb', line 19

def imw_indent(dir = :in, inst = true)
  pfx = '~ '
  fl = ' '
  inst ? '-' : '='
  $imw_depth ||= 0 # Initialize $imw_depth if not already initialized
  $imw_depth += 1 if dir == :in
  result = "#{fl * $imw_depth}#{pfx}" + (dir == :in ? '> ' : '< ')
  $imw_depth -= 1 if dir == :out
  result
end

#imw_ins(_obj = nil, _name = nil) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/instance_method_wrapper.rb', line 10

def imw_ins(_obj = nil, _name = nil)
  # warn "#{imw_indent}#{name} #{obj.inspect}"
  pfx = '~ '
  fl = ' '
  v = '-' #inst ? '-' : '='
  $imw_depth ||= 0 # Initialize $imw_depth if not already initialized
  "#{fl * $imw_depth}#{pfx}" + "#{v}i#{v}"
end