Class: RubyMemcheck::Suppression

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_memcheck/suppression.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, suppression_node) ⇒ Suppression

Returns a new instance of Suppression.



7
8
9
# File 'lib/ruby_memcheck/suppression.rb', line 7

def initialize(configuration, suppression_node)
  @root = suppression_node
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



5
6
7
# File 'lib/ruby_memcheck/suppression.rb', line 5

def root
  @root
end

Instance Method Details

#to_sObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ruby_memcheck/suppression.rb', line 11

def to_s
  str = StringIO.new
  str << "{\n"
  str << "  #{root.at_xpath("sname").content}\n"
  str << "  #{root.at_xpath("skind").content}\n"
  root.xpath("./sframe/fun | ./sframe/obj").each do |frame|
    str << "  #{frame.name}:#{frame.content}\n"
  end
  str << "}\n"
  str.string
end