module Arboretum::DocTree::Elements::Loggable

Public Instance Methods

log(*method_names) click to toggle source
# File lib/arboretum/doctree.rb, line 419
def log(*method_names)
  method_names.each do |name|
    method = instance_method(name)
    define_method(name) do |*args, &block|
      self.history << [name, args, caller]
      method.bind(self).(*args, &block)
    end
  end
end
log_string() click to toggle source
# File lib/arboretum/doctree.rb, line 428
def log_string
  lines = ""
  self.history.each {|h| lines << h.inspect << "\n"}
  lines
end