Module: MobyUtil::XML::Nokogiri::Builder

Defined in:
lib/tdriver/util/xml/parsers/nokogiri/builder.rb

Overview

behaviour

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object

support all Nokogiri::XML::Builder class instance methods



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/tdriver/util/xml/parsers/nokogiri/builder.rb', line 41

def method_missing( method, *args )

  if @xml.respond_to?( method )

    @xml.send( method.to_sym, *args )

  else

    raise NoMethodError, "Method #{ method.to_s.inspect } is not supported by #{ self.class }" 

  end

end

Instance Method Details

#build(&block) ⇒ Object



28
29
30
31
32
# File 'lib/tdriver/util/xml/parsers/nokogiri/builder.rb', line 28

def build( &block )

  @xml = ::Nokogiri::XML::Builder.new( &block )

end

#to_xmlObject



34
35
36
37
38
# File 'lib/tdriver/util/xml/parsers/nokogiri/builder.rb', line 34

def to_xml

  @xml.to_xml

end