Class: Gem::DependencyResolver::APISpecification
- Inherits:
-
Object
- Object
- Gem::DependencyResolver::APISpecification
- Defined in:
- lib/rubygems/dependency_resolver.rb
Overview
Represents a specification retrieved via the rubygems.org API. This is used to avoid having to load the full Specification object when all we need is the name, version, and dependencies.
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#set ⇒ Object
readonly
:nodoc:.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#==(other) ⇒ Object
:nodoc:.
- #full_name ⇒ Object
-
#initialize(set, api_data) ⇒ APISpecification
constructor
A new instance of APISpecification.
Constructor Details
#initialize(set, api_data) ⇒ APISpecification
Returns a new instance of APISpecification.
74 75 76 77 78 79 80 81 |
# File 'lib/rubygems/dependency_resolver.rb', line 74 def initialize(set, api_data) @set = set @name = api_data[:name] @version = Gem::Version.new api_data[:number] @dependencies = api_data[:dependencies].map do |name, ver| Gem::Dependency.new name, ver.split(/\s*,\s*/) end end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
83 84 85 |
# File 'lib/rubygems/dependency_resolver.rb', line 83 def dependencies @dependencies end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
83 84 85 |
# File 'lib/rubygems/dependency_resolver.rb', line 83 def name @name end |
#set ⇒ Object (readonly)
:nodoc:
72 73 74 |
# File 'lib/rubygems/dependency_resolver.rb', line 72 def set @set end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
83 84 85 |
# File 'lib/rubygems/dependency_resolver.rb', line 83 def version @version end |
Instance Method Details
#==(other) ⇒ Object
:nodoc:
85 86 87 88 89 90 91 |
# File 'lib/rubygems/dependency_resolver.rb', line 85 def == other # :nodoc: self.class === other and @set == other.set and @name == other.name and @version == other.version and @dependencies == other.dependencies end |
#full_name ⇒ Object
93 94 95 |
# File 'lib/rubygems/dependency_resolver.rb', line 93 def full_name "#{@name}-#{@version}" end |