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.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #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.
72 73 74 75 76 77 78 79 |
# File 'lib/rubygems/dependency_resolver.rb', line 72 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
81 82 83 |
# File 'lib/rubygems/dependency_resolver.rb', line 81 def dependencies @dependencies end |
#name ⇒ Object (readonly)
Returns the value of attribute name
81 82 83 |
# File 'lib/rubygems/dependency_resolver.rb', line 81 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version
81 82 83 |
# File 'lib/rubygems/dependency_resolver.rb', line 81 def version @version end |
Instance Method Details
#full_name ⇒ Object
83 84 85 |
# File 'lib/rubygems/dependency_resolver.rb', line 83 def full_name "#{@name}-#{@version}" end |