class Rexle::Elements

Public Class Methods

new(elements=[]) click to toggle source
Calls superclass method
# File lib/rexle.rb, line 1394
def initialize(elements=[])
  super()
  @elements = elements
end

Public Instance Methods

[](raw_i) click to toggle source
# File lib/rexle.rb, line 1399
def [](raw_i)

  raise 'Rexle::Elements index (-1) must be >= 1' unless raw_i > 0
  i = raw_i - 1
  @elements[i]
end
each(&blk) click to toggle source
# File lib/rexle.rb, line 1406
def each(&blk) @elements.each(&blk)  end
empty?() click to toggle source
# File lib/rexle.rb, line 1407
def empty?()   @elements.empty?      end
index(e=nil, &blk) click to toggle source
# File lib/rexle.rb, line 1409
def index(e=nil, &blk)
  
  if block_given? then
    @elements.index(&blk)
  else
    @elements.index e
  end
end
last() click to toggle source
# File lib/rexle.rb, line 1418
def last()     @elements.last        end
length() click to toggle source
# File lib/rexle.rb, line 1419
def length()   @elements.length      end
to_a() click to toggle source
# File lib/rexle.rb, line 1420
def to_a()     @elements             end