Class: TestXml::Matchers::XmlMatcher
- Inherits:
-
Object
- Object
- TestXml::Matchers::XmlMatcher
- Defined in:
- lib/test_xml/matchers.rb
Instance Attribute Summary collapse
-
#compare_value ⇒ Object
readonly
Returns the value of attribute compare_value.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(subject, pattern, compare_value) ⇒ XmlMatcher
constructor
A new instance of XmlMatcher.
- #match? ⇒ Boolean
Constructor Details
#initialize(subject, pattern, compare_value) ⇒ XmlMatcher
Returns a new instance of XmlMatcher.
5 6 7 8 9 |
# File 'lib/test_xml/matchers.rb', line 5 def initialize(subject, pattern, compare_value) @subject = Nokogiri::XML::Document.parse(subject) @pattern = Nokogiri::XML::Document.parse(pattern) @compare_value = compare_value end |
Instance Attribute Details
#compare_value ⇒ Object (readonly)
Returns the value of attribute compare_value.
4 5 6 |
# File 'lib/test_xml/matchers.rb', line 4 def compare_value @compare_value end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
4 5 6 |
# File 'lib/test_xml/matchers.rb', line 4 def pattern @pattern end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
4 5 6 |
# File 'lib/test_xml/matchers.rb', line 4 def subject @subject end |
Instance Method Details
#match? ⇒ Boolean
11 12 13 |
# File 'lib/test_xml/matchers.rb', line 11 def match? subject.match?(pattern, compare_value) end |