Sha256: aafe37c43c2d13648c21d038b2a869e41f9dc4a784d1212feb0c659c6230390e

Contents?: true

Size: 538 Bytes

Versions: 8

Compression:

Stored size: 538 Bytes

Contents

# frozen_string_literal: true

module Evertils
  class ActionRunner
    attr_accessor :params

    def execute
      case params.action
      when 'create'
        Action::Create.new(params)
      when 'create_multiple'
        Action::CreateMultiple.new(params.notes)
      when 'duplicate_previous'
        Action::DuplicatePrevious.new(params)
      when 'search'
        Action::Search.new(params)
      when 'group'
        Action::Group.new(params)
      else
        Action::Default.new(action: action)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
evertils-2.3.4 lib/evertils/action_runner.rb
evertils-2.3.3 lib/evertils/action_runner.rb
evertils-2.3.2 lib/evertils/action_runner.rb
evertils-2.3.1 lib/evertils/action_runner.rb
evertils-2.3.0 lib/evertils/action_runner.rb
evertils-2.2.4 lib/evertils/action_runner.rb
evertils-2.2.3 lib/evertils/action_runner.rb
evertils-2.2.2 lib/evertils/action_runner.rb