Class: PuppetfileResolver::Models::PuppetSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/puppetfile-resolver/models/puppet_specification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/puppetfile-resolver/models/puppet_specification.rb', line 6

def name
  @name
end

#versionObject

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_sObject



16
17
18
# File 'lib/puppetfile-resolver/models/puppet_specification.rb', line 16

def to_s
  @version.nil? ? name.to_s : "#{name}-#{version}"
end