class Prismatic::Page

Public Instance Methods

load(*args) click to toggle source
Calls superclass method
# File lib/prismatic/page.rb, line 4
def load(*args)
  super(*args)
  optionally_update_elements
end
method_missing(method_id, *args) click to toggle source
Calls superclass method
# File lib/prismatic/page.rb, line 14
def method_missing(method_id, *args)
  optionally_update_elements
  return super unless methods.include?(method_id)
  send(method_id, *args)
end
respond_to?(method_id, include_all = false) click to toggle source
# File lib/prismatic/page.rb, line 9
def respond_to?(method_id, include_all = false)
  optionally_update_elements
  methods.include?(method_id)
end

Private Instance Methods

optionally_set_url_matcher() click to toggle source
# File lib/prismatic/page.rb, line 28
def optionally_set_url_matcher
  return unless self.class.url_matcher.nil?
  return if self.class.url.nil?
  return unless Prismatic.auto_create_url_matcher
  self.class.set_url_matcher %r(^https?://[^/]+#{self.class.url}([#\?].*)?$)
end
optionally_update_elements() click to toggle source
# File lib/prismatic/page.rb, line 22
def optionally_update_elements
  optionally_set_url_matcher
  return unless displayed?(0)
  update_elements
end