class Lebowski::SCUI::Views::ContentEditableViewSupport::DOMElementList

Attributes

selector[R]

Public Class Methods

new(view, selector) click to toggle source
# File lib/lebowski/scui/views/content_editable.rb, line 383
def initialize(view, selector)
  @selector = selector
  @view = view
end

Public Instance Methods

[](index) click to toggle source
# File lib/lebowski/scui/views/content_editable.rb, line 400
def [](index)
  if not index.kind_of? Integer or index < 0 or index >= count
    raise ArgumentError.new "index is out of bounds: #{index}"
  end
  
  return DOMElement.new @view, @selector, index
end
count() click to toggle source
# File lib/lebowski/scui/views/content_editable.rb, line 392
def count()
  value = 0
  @view.frame.exec_driver_in_context do |driver|
    value = driver.get_css_selector_count(@selector)
  end
  return value
end
each() { |dom_element| ... } click to toggle source
# File lib/lebowski/scui/views/content_editable.rb, line 408
def each(&block)
  return if empty?
  
  (0..count).each do |index|
    yield DOMElement.new(@view, @selector, index)
  end
end
empty?() click to toggle source
# File lib/lebowski/scui/views/content_editable.rb, line 388
def empty?()
  return (count == 0)
end