Class: FastXml::NodeList
- Inherits:
-
Object
- Object
- FastXml::NodeList
- Includes:
- Enumerable
- Defined in:
- lib/fastxml_lib.rb,
ext/fastxml.c
Instance Method Summary collapse
- #[](idx) ⇒ Object
- #at(tgt) ⇒ Object
- #each ⇒ Object
- #empty? ⇒ Boolean
- #entry ⇒ Object
- #first ⇒ Object
- #initialize ⇒ Object constructor
- #last ⇒ Object
- #length ⇒ Object
- #to_ary ⇒ Object
Constructor Details
#initialize ⇒ Object
Instance Method Details
#[](idx) ⇒ Object
60 61 62 |
# File 'lib/fastxml_lib.rb', line 60 def [](idx) self.entry(idx) end |
#at(tgt) ⇒ Object
76 77 78 79 80 81 |
# File 'lib/fastxml_lib.rb', line 76 def at(tgt) return self.entry( tgt.to_i ) if tgt =~ /^\d+$/ ret = [] each { |nd| ret << (nd/tgt).to_ary } ret.flatten! end |
#each ⇒ Object
#empty? ⇒ Boolean
72 73 74 |
# File 'lib/fastxml_lib.rb', line 72 def empty? return (length == 0) end |
#entry ⇒ Object
#first ⇒ Object
64 65 66 |
# File 'lib/fastxml_lib.rb', line 64 def first self.entry(0) end |
#last ⇒ Object
68 69 70 |
# File 'lib/fastxml_lib.rb', line 68 def last self.entry(-1) end |