class RSpecHTML::Element

HTML DOM element abstraction

Attributes

element[R]
name[R]

Public Class Methods

new(element, name, options: {}, siblings: []) click to toggle source
# File lib/rspec_html/element.rb, line 13
def initialize(element, name, options: {}, siblings: [])
  @name = name
  @element = element
  @options = options
  @siblings = siblings
  @search = Search.new(@element, @siblings)
end
reconstituted(tag, options = {}) click to toggle source
# File lib/rspec_html/element.rb, line 49
def self.reconstituted(tag, options = {})
  ReconstitutedElement.new(tag, options).to_s
end

Public Instance Methods

exist?()
Alias for: present?
inspect() click to toggle source
# File lib/rspec_html/element.rb, line 28
def inspect
  "<#{self.class}::#{name.to_s.capitalize}>"
end
present?() click to toggle source
# File lib/rspec_html/element.rb, line 21
def present?
  return true if name == :document

  @search.present?
end
Also aliased as: exist?
reconstituted() click to toggle source
# File lib/rspec_html/element.rb, line 45
def reconstituted
  self.class.reconstituted(name, @options)
end
to_s() click to toggle source
# File lib/rspec_html/element.rb, line 32
def to_s
  @element.to_s
end