class PageSourceSnapshot::Elements
Attributes
elements[R]
Public Class Methods
new(ignore_attributes = [])
click to toggle source
# File lib/page_source_snapshot/elements.rb, line 5 def initialize(ignore_attributes = []) raise "ignore_attributes should be Array. Not #{ignore_attributes.class}" unless ignore_attributes.is_a? Array @ignore_attributes = ignore_attributes @elements = [] end
Public Instance Methods
on_element(namespace, name, attrs = {})
click to toggle source
# File lib/page_source_snapshot/elements.rb, line 12 def on_element(namespace, name, attrs = {}) @ignore_attributes.each { |v| attrs.delete v } unless @ignore_attributes.empty? @elements << [name, attrs] end