Sha256: fa93c6ed63658538a1cd3f1595240e532c08c9454681eb99fc5e7bf0673dc4f3

Contents?: true

Size: 567 Bytes

Versions: 2

Compression:

Stored size: 567 Bytes

Contents

module PageMagic
  # module ClassMethods - contains class level methods for PageObjects
  module ClassMethods
    DEFAULT_ON_LOAD = proc {}

    # getter setter for storing the page url
    # @param [String] url the url of the page
    def url(url = nil)
      @url = url if url
      @url
    end

    # sets block to run when page has loaded
    # if one has not been set on the page object class it will return a default block that does nothing
    def on_load(&block)
      return @on_load || DEFAULT_ON_LOAD unless block
      @on_load = block
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
page_magic-1.0.0.alpha20 lib/page_magic/class_methods.rb
page_magic-1.0.0.alpha19 lib/page_magic/class_methods.rb