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



369
370
371
372
373
374
375
# File 'lib/magic_xml.rb', line 369

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



377
378
379
380
381
382
383
# File 'lib/magic_xml.rb', line 377

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