Class: Kuby::Dependency

Inherits:
Object
  • Object
show all
Defined in:
lib/kuby/dependency.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#constraintsObject (readonly)

Returns the value of attribute constraints.



3
4
5
# File 'lib/kuby/dependency.rb', line 3

def constraints
  @constraints
end

#nameObject (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

Returns:

  • (Boolean)


10
11
12
# File 'lib/kuby/dependency.rb', line 10

def satisfied_by?(dependable)
  constraints.satisfied_by?(dependable.version)
end