Class: Mudguard::Domain::Dependency
- Inherits:
-
Object
- Object
- Mudguard::Domain::Dependency
- Defined in:
- lib/mudguard/domain/dependency.rb
Overview
A Dependency between Modules
Instance Attribute Summary collapse
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(dependency:, location: nil) ⇒ Dependency
constructor
A new instance of Dependency.
- #inspect ⇒ Object
- #match(policy) ⇒ Object
Constructor Details
#initialize(dependency:, location: nil) ⇒ Dependency
Returns a new instance of Dependency.
9 10 11 12 |
# File 'lib/mudguard/domain/dependency.rb', line 9 def initialize(dependency:, location: nil) @location = location @dependency = dependency end |
Instance Attribute Details
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
7 8 9 |
# File 'lib/mudguard/domain/dependency.rb', line 7 def dependency @dependency end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
7 8 9 |
# File 'lib/mudguard/domain/dependency.rb', line 7 def location @location end |
Instance Method Details
#==(other) ⇒ Object
22 23 24 25 |
# File 'lib/mudguard/domain/dependency.rb', line 22 def ==(other) @location == other.instance_eval { @location } && @dependency == other.instance_eval { @dependency } end |
#inspect ⇒ Object
14 15 16 |
# File 'lib/mudguard/domain/dependency.rb', line 14 def inspect "{#{@location}, #{@dependency}}" end |
#match(policy) ⇒ Object
18 19 20 |
# File 'lib/mudguard/domain/dependency.rb', line 18 def match(policy) @dependency.match(policy) end |