Sha256: 934e2f3c42b7ab4de97168589328048b70f95d4e0d0154240289dfdafdaf0f1c

Contents?: true

Size: 588 Bytes

Versions: 15

Compression:

Stored size: 588 Bytes

Contents

module Screengem
  #
  # Concern that adds the ability to create actions.
  #
  module Actionable
    extend ActiveSupport::Concern

    def action
      @action ||= action_factory
    end

    private

    #
    # Choose the specified action factory. Default to the standard action factory.
    #
    def action_factory
      if browser_factory?
        Screengem::Factories::BrowserActionFactory.instance
      else
        Screengem::Factories::StandardActionFactory.instance
      end
    end

    def browser_factory?
      Screengem.configuration.browser_actions?
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
screengem-0.9.1 lib/screengem/concerns/actionable.rb
screengem-0.9.0 lib/screengem/concerns/actionable.rb
screengem-0.8.1 lib/screengem/concerns/actionable.rb
screengem-0.8.0 lib/screengem/concerns/actionable.rb
screengem-0.7.3 lib/screengem/concerns/actionable.rb
screengem-0.7.2 lib/screengem/concerns/actionable.rb
screengem-0.7.1 lib/screengem/concerns/actionable.rb
screengem-0.6.0 lib/screengem/concerns/actionable.rb
screengem-0.5.0 lib/screengem/concerns/actionable.rb
screengem-0.4.0 lib/screengem/concerns/actionable.rb
screengem-0.3.0 lib/screengem/concerns/actionable.rb
screengem-0.2.0 lib/screengem/concerns/actionable.rb
screengem-0.1.2 lib/screengem/concerns/actionable.rb
screengem-0.1.1 lib/screengem/concerns/actionable.rb
screengem-0.1.0 lib/screengem/concerns/actionable.rb