Class: Scorpion::Dependency::ArgumentDependency

Inherits:
Scorpion::Dependency show all
Defined in:
lib/scorpion/dependency/argument_dependency.rb

Overview

Scorpion::Dependency for an captured argument.

See Also:

  • {Scorpion#argument}.

Instance Attribute Summary collapse

Attributes inherited from Scorpion::Dependency

#contract

Instance Method Summary collapse

Methods inherited from Scorpion::Dependency

#==, define, #hash, #inspect, #release, #replicate

Constructor Details

#initialize(argument) ⇒ ArgumentDependency

Returns a new instance of ArgumentDependency.



11
12
13
# File 'lib/scorpion/dependency/argument_dependency.rb', line 11

def initialize( argument )
  @argument = argument
end

Instance Attribute Details

#argumentObject (readonly)

Returns the value of attribute argument.



9
10
11
# File 'lib/scorpion/dependency/argument_dependency.rb', line 9

def argument
  @argument
end

Instance Method Details

#fetch(*args) ⇒ Object



15
16
17
# File 'lib/scorpion/dependency/argument_dependency.rb', line 15

def fetch( *args )
  argument
end

#satisfies?(contract) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/scorpion/dependency/argument_dependency.rb', line 19

def satisfies?( contract )
  contract === argument
end