Sha256: 568d6d9b63f775249d57ebf22276ab45e1f24e817a202df6407e4654e1c25419

Contents?: true

Size: 1.1 KB

Versions: 15

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true
# Base class for rules that we write.

module Entitlements
  class Data
    class Groups
      class Calculated
        class Rules
          class Base
            include ::Contracts::Core
            C = ::Contracts

            # Interface method: Get a Set[Entitlements::Models::Person] matching this condition.
            #
            # value  - The value to match.
            # filename - Name of the file resulting in this rule being called
            # options  - Optional hash of additional method-specific options
            #
            # Returns a Set[Entitlements::Models::Person].
            Contract C::KeywordArgs[
              value: String,
              filename: C::Maybe[String],
              options: C::Optional[C::HashOf[Symbol => C::Any]]
            ] => C::SetOf[Entitlements::Models::Person]
            def self.matches(value:, filename: nil, options: {})
              # :nocov:
              raise "matches() must be defined in the child class #{self.class}!"
              # :nocov:
            end
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
entitlements-app-1.2.0 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-app-1.1.0 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-app-1.0.0 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-app-0.3.4 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-app-0.3.1 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-app-0.3.0 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-0.2.1 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-app-0.2.1 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-0.2.0 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-app-0.2.0 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-0.1.8 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-app-0.1.8 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-0.1.7 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-app-0.1.7 lib/entitlements/data/groups/calculated/rules/base.rb
entitlements-app-0.1.6 lib/entitlements/data/groups/calculated/rules/base.rb