Base
# File lib/debugger/printers/xml.rb, line 7 def print(path, args = {}) case parts(path)[1] when "errors" print_error(path, args) when "confirmations" print_confirmation(path, args) when "debug" print_debug(path, args) when "messages" print_message(path, args) else print_general(path, args) end end
# File lib/debugger/printers/xml.rb, line 22 def print_collection(path, collection, &block) settings = locate(path) xml = ::Builder::XmlMarkup.new tag = translate(settings["tag"]) xml.tag!("#{tag}s") do |xml| array_of_args(collection, &block).each do |args| xml.tag!(tag, translated_attributes(settings["attributes"], args)) end end end
# File lib/debugger/printers/xml.rb, line 39 def print_instance_variables(object) variables = if object.is_a?(Array) object.each.with_index.map { |item, index| ["[#{index}]", item, 'instance'] } elsif object.is_a?(Hash) object.map { |key, value| [key.is_a?(String) ? "'#{key}'" : key.to_s, value, 'instance'] } else AllVariables.new(object).variables end print_variables(variables, nil) end
Generated with the Darkfish Rdoc Generator 2.