Method: Celerity::ElementCollection#length

Defined in:
lib/celerity/element_collection.rb

#lengthFixnum Also known as: size

Returns The number of elements in this collection.

Returns:

  • (Fixnum)

    The number of elements in this collection.



25
26
27
28
29
30
31
32
# File 'lib/celerity/element_collection.rb', line 25

def length
  if @object
    @object.length
  else
    @elements ||= ElementLocator.new(@container, element_class).elements_by_idents
    @elements.size
  end
end