Sha256: 6033801960502310ebc8b9a5227d1ece95e3f8b955054835c9779e74a38961ad

Contents?: true

Size: 473 Bytes

Versions: 27

Compression:

Stored size: 473 Bytes

Contents

require 'scorpion/dependency'

module Scorpion
  class Dependency
    # {Dependency} for an captured argument.
    # @see {Scorpion#argument}.
    class ArgumentDependency < Scorpion::Dependency

      attr_reader :argument

      def initialize( argument )
        @argument = argument
      end

      def fetch( *args )
        argument
      end

      def satisfies?( contract, traits = nil )
        contract === argument && traits.blank?
      end

    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
scorpion-ioc-0.5.6 lib/scorpion/dependency/argument_dependency.rb
scorpion-ioc-0.5.5 lib/scorpion/dependency/argument_dependency.rb
scorpion-ioc-0.5.4 lib/scorpion/dependency/argument_dependency.rb
scorpion-ioc-0.5.2 lib/scorpion/dependency/argument_dependency.rb
scorpion-ioc-0.5.1 lib/scorpion/dependency/argument_dependency.rb
scorpion-ioc-0.5.0 lib/scorpion/dependency/argument_dependency.rb
scorpion-ioc-0.4.0 lib/scorpion/dependency/argument_dependency.rb