Class: PuppetfileResolver::Models::PuppetSpecification
- Inherits:
-
Object
- Object
- PuppetfileResolver::Models::PuppetSpecification
- Defined in:
- lib/puppetfile-resolver/models/puppet_specification.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #dependencies(*_) ⇒ Object
-
#initialize(version) ⇒ PuppetSpecification
constructor
A new instance of PuppetSpecification.
- #to_s ⇒ Object
Constructor Details
#initialize(version) ⇒ PuppetSpecification
Returns a new instance of PuppetSpecification.
9 10 11 12 13 14 |
# File 'lib/puppetfile-resolver/models/puppet_specification.rb', line 9 def initialize(version) require 'semantic_puppet' @name = 'Puppet' @version = version.nil? ? nil : ::SemanticPuppet::Version.parse(version) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/puppetfile-resolver/models/puppet_specification.rb', line 6 def name @name end |
#version ⇒ Object
Returns the value of attribute version.
7 8 9 |
# File 'lib/puppetfile-resolver/models/puppet_specification.rb', line 7 def version @version end |
Instance Method Details
#dependencies(*_) ⇒ Object
20 21 22 |
# File 'lib/puppetfile-resolver/models/puppet_specification.rb', line 20 def dependencies(*_) [] end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/puppetfile-resolver/models/puppet_specification.rb', line 16 def to_s @version.nil? ? name.to_s : "#{name}-#{version}" end |