Class: REXML::Parent
- Inherits:
-
Object
- Object
- REXML::Parent
- Defined in:
- lib/xml/rexml_ext.rb
Instance Method Summary collapse
- #each_on_axis(axis, &block) ⇒ Object
- #each_on_axis_child ⇒ Object
- #each_on_axis_descendant(&block) ⇒ Object
- #each_on_axis_self {|_self| ... } ⇒ Object
Instance Method Details
#each_on_axis(axis, &block) ⇒ Object
142 143 144 |
# File 'lib/xml/rexml_ext.rb', line 142 def each_on_axis(axis, &block) send :"each_on_axis_#{axis}", &block end |
#each_on_axis_child ⇒ Object
118 119 120 121 122 123 124 125 126 127 |
# File 'lib/xml/rexml_ext.rb', line 118 def each_on_axis_child if respond_to? :attributes attributes.each_key do |name| yield XML::XXPath::Accessors::Attribute.new(self, name, false) end end each_child do |c| yield c end end |
#each_on_axis_descendant(&block) ⇒ Object
129 130 131 132 133 134 135 136 |
# File 'lib/xml/rexml_ext.rb', line 129 def each_on_axis_descendant(&block) each_on_axis_child do |c| block.call c if REXML::Parent===c c.each_on_axis_descendant(&block) end end end |
#each_on_axis_self {|_self| ... } ⇒ Object
138 139 140 |
# File 'lib/xml/rexml_ext.rb', line 138 def each_on_axis_self yield self end |