Sha256: 8bb665779cb8efc153a6e92ae31d03bfd23e2e0e722e180c0de5e961044bd905

Contents?: true

Size: 638 Bytes

Versions: 22

Compression:

Stored size: 638 Bytes

Contents

require "contracts/engine/base"
require "contracts/engine/target"
require "contracts/engine/eigenclass"

require "forwardable"

module Contracts
  # Engine facade, normally you shouldn't refer internals of Engine
  # module directly.
  module Engine
    class << self
      extend Forwardable

      # .apply(klass)      - enables contracts engine on klass
      # .applied?(klass)   - returns true if klass has contracts engine
      # .fetch_from(klass) - returns contracts engine for klass
      def_delegators :base_engine, :apply, :applied?, :fetch_from

      private

      def base_engine
        Base
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 6 rubygems

Version Path
entitlements-app-1.1.0 lib/contracts-ruby2/lib/contracts/engine.rb
entitlements-app-1.0.0 lib/contracts-ruby2/lib/contracts/engine.rb
entitlements-app-0.3.4 lib/contracts-ruby2/lib/contracts/engine.rb
entitlements-app-0.3.1 lib/contracts-ruby2/lib/contracts/engine.rb
entitlements-app-0.3.0 lib/contracts-ruby2/lib/contracts/engine.rb
entitlements-0.2.1 lib/contracts-ruby2/lib/contracts/engine.rb
entitlements-app-0.2.1 lib/contracts-ruby2/lib/contracts/engine.rb
entitlements-0.2.0 lib/contracts-ruby2/lib/contracts/engine.rb
entitlements-app-0.2.0 lib/contracts-ruby2/lib/contracts/engine.rb
contracts-0.16.1 lib/contracts/engine.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/contracts-0.16.0/lib/contracts/engine.rb
contracts-0.16.0 lib/contracts/engine.rb
contracts-0.15.0 lib/contracts/engine.rb
contracts-lite-0.15.0 lib/contracts/engine.rb
contracts-lite-0.14.0 lib/contracts/engine.rb
contracts-0.14.0 lib/contracts/engine.rb
contracts-0.13.0 lib/contracts/engine.rb
contracts-0.12.0 lib/contracts/engine.rb
contracts-0.11.0 lib/contracts/engine.rb