Sha256: 22fff1b36c2610d291068143b52d5b92171e2e6ebcc8c72ba8f468af7ffb885c

Contents?: true

Size: 304 Bytes

Versions: 1

Compression:

Stored size: 304 Bytes

Contents

module Kan
  class AbilitiesList
    def initialize(name, list)
      @name = name
      @list = list
    end

    def call(*payload)
      @list
        .select { |abilities| abilities.class.valid_role?(*payload) }
        .any? { |abilities| abilities.ability(@name).call(*payload) }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kan-0.2.0 lib/kan/abilities_list.rb