Class: Gem::Guardian::Dependency
- Inherits:
-
Data
- Object
- Data
- Gem::Guardian::Dependency
- Defined in:
- lib/gem/guardian/dependency.rb
Overview
A gem dependency identified by name, version, and platform.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#platform ⇒ Object
readonly
Returns the value of attribute platform.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#gem_filename ⇒ Object
Returns the canonical .gem filename for this dependency.
-
#initialize(name:, version:, platform:, source: nil) ⇒ Dependency
constructor
A new instance of Dependency.
Constructor Details
#initialize(name:, version:, platform:, source: nil) ⇒ Dependency
Returns a new instance of Dependency.
7 8 9 |
# File 'lib/gem/guardian/dependency.rb', line 7 def initialize(name:, version:, platform:, source: nil) super end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name
6 7 8 |
# File 'lib/gem/guardian/dependency.rb', line 6 def name @name end |
#platform ⇒ Object (readonly)
Returns the value of attribute platform
6 7 8 |
# File 'lib/gem/guardian/dependency.rb', line 6 def platform @platform end |
#source ⇒ Object (readonly)
Returns the value of attribute source
6 7 8 |
# File 'lib/gem/guardian/dependency.rb', line 6 def source @source end |
#version ⇒ Object (readonly)
Returns the value of attribute version
6 7 8 |
# File 'lib/gem/guardian/dependency.rb', line 6 def version @version end |
Instance Method Details
#gem_filename ⇒ Object
Returns the canonical .gem filename for this dependency.
12 13 14 15 |
# File 'lib/gem/guardian/dependency.rb', line 12 def gem_filename platform_suffix = platform && platform != "ruby" ? "-#{platform}" : "" "#{name}-#{version}#{platform_suffix}.gem" end |