Sha256: 9602959a6df8258dba2449df9b2357f35a498203857ef2aeb2eaec1ac3f23588

Contents?: true

Size: 371 Bytes

Versions: 11

Compression:

Stored size: 371 Bytes

Contents

# frozen_string_literal: true

require 'parametric/block_validator'

module Parametric
  class Registry
    attr_reader :policies

    def initialize
      @policies = {}
    end

    def coercions
      policies
    end

    def policy(name, plcy = nil, &block)
      policies[name] = (plcy || BlockValidator.build(:instance_eval, &block))
      self
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
parametric-0.2.21 lib/parametric/registry.rb
parametric-0.2.20 lib/parametric/registry.rb
parametric-0.2.19 lib/parametric/registry.rb
parametric-0.2.18 lib/parametric/registry.rb
parametric-0.2.17 lib/parametric/registry.rb
parametric-0.2.16 lib/parametric/registry.rb
parametric-0.2.15 lib/parametric/registry.rb
parametric-0.2.14 lib/parametric/registry.rb
parametric-0.2.13 lib/parametric/registry.rb
parametric-0.2.12 lib/parametric/registry.rb
parametric-0.2.11 lib/parametric/registry.rb