Sha256: 6cb3083fb1c99498b13960b600220e87be75893a0145144e34505747e5b5f7e6

Contents?: true

Size: 792 Bytes

Versions: 26

Compression:

Stored size: 792 Bytes

Contents

module Foobara
  # TODO: move to foobara monorepo if this is generic...
  class CommandRegistry
    class AllowedRule
      class << self
        def allowed_rule_attributes_type
          @allowed_rule_attributes_type ||= GlobalDomain.foobara_type_from_declaration(
            symbol: :symbol,
            # TODO: add a function type and a way to union two types so that we can string or function type checking
            explanation: :duck,
            logic: :duck
          )
        end
      end

      attr_accessor :block, :explanation, :symbol

      def initialize(symbol: nil, explanation: nil, &block)
        self.symbol = symbol
        self.block = block
        self.explanation = explanation || symbol
      end

      def to_proc
        block
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foobara-0.0.26 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.25 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.24 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.23 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.22 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.21 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.20 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.19 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.18 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.17 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.16 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.15 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.14 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.13 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.12 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.11 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.10 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.9 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.8 projects/command_connectors/src/command_registry/allowed_rule.rb
foobara-0.0.7 projects/command_connectors/src/command_registry/allowed_rule.rb