Class: Array

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

Instance Method Summary collapse

Instance Method Details

#children(*args, &blk) ⇒ Object

children of any element



339
340
341
342
343
344
345
# File 'lib/magic_xml.rb', line 339

def children(*args, &blk)
  res = []
  each{|c|
    res += c.children(*args, &blk) if c.is_a? XML
  }
  res
end

#descendants(*args, &blk) ⇒ Object

descendants of any element



347
348
349
350
351
352
353
# File 'lib/magic_xml.rb', line 347

def descendants(*args, &blk)
  res = []
  each{|c|
    res += c.descendants(*args, &blk) if c.is_a? XML
  }
  res
end