Sha256: 2b988802e748cd4a251405a5fca7b89e1d34294788e425376c8bd317022e31b2

Contents?: true

Size: 649 Bytes

Versions: 1

Compression:

Stored size: 649 Bytes

Contents

module Calabash
  class Page
    # For auto-completion
    include Calabash

    def self.inherited(subclass)
      # Define the page into global scope
      name = subclass.to_s.split('::').last

      unless Object.const_defined?(name.to_sym)
        # We need a unique type for this constant
        clz = Class.new(StubPage)
        Object.const_set(name.to_sym, clz)
      end
    end

    private_class_method :new

    def initialize(world)
      @world = world
    end

    def trait
      raise 'Implement your own trait'
    end

    def await(options={})
      wait_for_view(trait, options)
    end

    class StubPage

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
calabash-1.9.9.pre2 lib/calabash/page.rb