Class: FastXml::NodeList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/fastxml_lib.rb,
ext/fastxml.c

Instance Method Summary collapse

Constructor Details

#initializeObject

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

#eachObject

#empty?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/fastxml_lib.rb', line 72

def empty?
  return (length == 0)
end

#entryObject

#firstObject



64
65
66
# File 'lib/fastxml_lib.rb', line 64

def first
  self.entry(0)
end

#lastObject



68
69
70
# File 'lib/fastxml_lib.rb', line 68

def last
  self.entry(-1)
end

#lengthObject

#to_aryObject