# File lib/debugger/printers/xml.rb, line 102 def has_children? if @value.is_a?(Array) || @value.is_a?(Hash) !@value.empty? else !@value.instance_variables.empty? || !@value.class.class_variables.empty? end rescue false end
# File lib/debugger/printers/xml.rb, line 133 def id @value.respond_to?(:object_id) ? "%#+x" % @value.object_id : nil rescue nil end
# File lib/debugger/printers/xml.rb, line 145 def to_hash {name: @name, kind: @kind, value: value, type: type, has_children: has_children?, id: id} end
# File lib/debugger/printers/xml.rb, line 139 def type @value.class rescue "Undefined" end
# File lib/debugger/printers/xml.rb, line 112 def value if @value.is_a?(Array) || @value.is_a?(Hash) if has_children? "#{@value.class} (#{@value.size} element(s))" else "Empty #{@value.class}" end else value_str = @value.nil? ? 'nil' : @value.to_s if !value_str.is_a?(String) "ERROR: #{@value.class}.to_s method returns #{value_str.class}. Should return String." elsif binary_data?(value_str) "[Binary Data]" else value_str.gsub(/^(")(.*)(")$/, '\2') end end rescue => e "<raised exception: #{e}>" end
Generated with the Darkfish Rdoc Generator 2.