Sha256: 833a2f413ddfe519533b9dc68f4d86f67799004f3e5a11e007e8f5fa64ccf230

Contents?: true

Size: 984 Bytes

Versions: 8

Compression:

Stored size: 984 Bytes

Contents

module Symbiont
  module Factory
    
    # Creates a definition context for actions.
    #
    # @param [Class] definition The name of a definition class
    # @param [optional] block Logic to execute within the context of the
    # definition
    # @return [Object] instance of the definition
    def on(definition, &block)
      @active = definition.new(@browser)
      block.call @active if block
      @active
    end
    
    # Creates a definition context for actions and establishes the
    # context for display.
    #
    # @param [Class] definition The name of a definition class
    # @param [optional] block Logic to execute within the context of the
    # definition
    # @return [Object] instance of the definition
    def on_view(definition, &block)
      @active = definition.new(@browser, true)
      block.call @active if block
      @active
    end
    
    alias :during :on
    alias :start_activity :on_view
    
  end # module: Factory
end # module: Symbiont

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
symbiont-0.1.5 lib/symbiont/factory.rb
symbiont-0.1.4 lib/symbiont/factory.rb
symbiont-0.1.3 lib/symbiont/factory.rb
symbiont-0.1.2 lib/symbiont/factory.rb
symbiont-0.1.1 lib/symbiont/factory.rb
symbiont-0.1.0 lib/symbiont/factory.rb
symbiont-0.0.4 lib/symbiont/factory.rb
symbiont-0.0.3 lib/symbiont/factory.rb