Sha256: a813c1c863b42d6b32100a9cffbb216c7aea80786d18559efdab7358ccbbe6ba

Contents?: true

Size: 300 Bytes

Versions: 9

Compression:

Stored size: 300 Bytes

Contents

module Qe
  module Action
    MissingActionError = Class.new(StandardError)

    def perform
      action = options.fetch(:action, :default)

      raise MissingActionError,
        "the action #{action.inspect} is not defined" unless respond_to?(action)

      public_send(action)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
qe-0.4.0 lib/qe/action.rb
qe-0.3.5 lib/qe/action.rb
qe-0.3.4 lib/qe/action.rb
qe-0.3.3 lib/qe/action.rb
qe-0.3.2 lib/qe/action.rb
qe-0.3.1 lib/qe/action.rb
qe-0.3.0 lib/qe/action.rb
qe-0.2.1 lib/qe/action.rb
qe-0.2.0 lib/qe/action.rb