Class: Kuby::Dependency
- Inherits:
-
Object
- Object
- Kuby::Dependency
- Defined in:
- lib/kuby/dependency.rb
Instance Attribute Summary collapse
-
#constraints ⇒ Object
readonly
Returns the value of attribute constraints.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, *constraints) ⇒ Dependency
constructor
A new instance of Dependency.
- #satisfied_by?(dependable) ⇒ Boolean
Constructor Details
#initialize(name, *constraints) ⇒ Dependency
Returns a new instance of Dependency.
5 6 7 8 |
# File 'lib/kuby/dependency.rb', line 5 def initialize(name, *constraints) @name = name @constraints = Kuby::Utils::SemVer.parse_constraints(*constraints) end |
Instance Attribute Details
#constraints ⇒ Object (readonly)
Returns the value of attribute constraints.
3 4 5 |
# File 'lib/kuby/dependency.rb', line 3 def constraints @constraints end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/kuby/dependency.rb', line 3 def name @name end |
Instance Method Details
#satisfied_by?(dependable) ⇒ Boolean
10 11 12 |
# File 'lib/kuby/dependency.rb', line 10 def satisfied_by?(dependable) constraints.satisfied_by?(dependable.version) end |