Class: Gem::DependencyResolver::DependencyRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/rubygems/dependency_resolver.rb

Overview

Used Internally. Wraps a Depedency object to also track which spec contained the Dependency.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dep, act) ⇒ DependencyRequest

Returns a new instance of DependencyRequest.



328
329
330
331
# File 'lib/rubygems/dependency_resolver.rb', line 328

def initialize(dep, act)
  @dependency = dep
  @requester = act
end

Instance Attribute Details

#dependencyObject (readonly)

Returns the value of attribute dependency.



333
334
335
# File 'lib/rubygems/dependency_resolver.rb', line 333

def dependency
  @dependency
end

#requesterObject (readonly)

Returns the value of attribute requester.



333
334
335
# File 'lib/rubygems/dependency_resolver.rb', line 333

def requester
  @requester
end

Instance Method Details

#==(other) ⇒ Object



347
348
349
350
351
352
353
354
355
356
# File 'lib/rubygems/dependency_resolver.rb', line 347

def ==(other)
  case other
  when Dependency
    @dependency == other
  when DependencyRequest
    @dependency == other.dependency && @requester == other.requester
  else
    false
  end
end

#matches_spec?(spec) ⇒ Boolean

Returns:

  • (Boolean)


339
340
341
# File 'lib/rubygems/dependency_resolver.rb', line 339

def matches_spec?(spec)
  @dependency.matches_spec? spec
end

#nameObject



335
336
337
# File 'lib/rubygems/dependency_resolver.rb', line 335

def name
  @dependency.name
end

#to_sObject



343
344
345
# File 'lib/rubygems/dependency_resolver.rb', line 343

def to_s
  @dependency.to_s
end