Class: MobyUtil::XML::NilNode

Inherits:
Object
  • Object
show all
Includes:
Abstraction
Defined in:
lib/tdriver/util/xml/nil_node.rb

Instance Attribute Summary

Attributes included from Abstraction

#xml

Instance Method Summary collapse

Methods included from Abstraction

#attribute?, #clone!, #comment?, #document?, #element?, #initialize, #inspect, #nodeset?, #text?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *method_arguments) ⇒ Object

Raises:

  • (RuntimeError)


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

def method_missing( method, *method_arguments )

  raise RuntimeError, "Method #{ method.to_s.inspect } is not supported by #{ self.class } object (#{ MobyUtil::XML.current_parser })"

end

Instance Method Details

#contentObject



70
71
72
73
74
# File 'lib/tdriver/util/xml/nil_node.rb', line 70

def content

  nil

end

#empty?Boolean

Returns:

  • (Boolean)


64
65
66
67
68
# File 'lib/tdriver/util/xml/nil_node.rb', line 64

def empty?

  true

end

#eql?(object) ⇒ Boolean

Returns:

  • (Boolean)


58
59
60
61
62
# File 'lib/tdriver/util/xml/nil_node.rb', line 58

def eql?( object )

  nil == object.xml.content

end

#inner_xmlObject



82
83
84
85
86
# File 'lib/tdriver/util/xml/nil_node.rb', line 82

def inner_xml

  ""

end

#nameObject



40
41
42
43
44
# File 'lib/tdriver/util/xml/nil_node.rb', line 40

def name

  nil

end

#nil?Boolean

Returns:

  • (Boolean)


52
53
54
55
56
# File 'lib/tdriver/util/xml/nil_node.rb', line 52

def nil?

  true

end

#sizeObject



46
47
48
49
50
# File 'lib/tdriver/util/xml/nil_node.rb', line 46

def size

  0

end

#to_sObject



76
77
78
79
80
# File 'lib/tdriver/util/xml/nil_node.rb', line 76

def to_s

  ""

end

#xml=(value) ⇒ Object



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

def xml=( value )

  @xml = nil

end