Sha256: 0f8c3c7041dd98640ba313be1eaa30ea1c2b577e60c937e3abe93a19fa828dae

Contents?: true

Size: 386 Bytes

Versions: 5

Compression:

Stored size: 386 Bytes

Contents

module CanTango::Ability::Mode
  class Finder
    attr_reader :executor

    delegate :candidate, :ability, :options, :to => :executor

    def initialize executor
      @executor = executor
    end

    def executor_for mode
      class_for(mode).new ability, options
    end

    def class_for mode
      "CanTango::Ability::Mode::#{mode.to_s.camelize}".constantize
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cantango-core-0.1.9.3 lib/cantango/ability/mode/finder.rb
cantango-core-0.1.9.2 lib/cantango/ability/mode/finder.rb
cantango-core-0.1.9.1 lib/cantango/ability/mode/finder.rb
cantango-core-0.1.9 lib/cantango/ability/mode/finder.rb
cantango-core-0.1.8 lib/cantango/ability/mode/finder.rb