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



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

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



355
356
357
358
359
360
361
# File 'lib/magic_xml.rb', line 355

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