Class: PuppetfileResolver::Puppetfile::BaseModule

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title) ⇒ BaseModule

Returns a new instance of BaseModule.



36
37
38
39
40
41
42
43
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 36

def initialize(title)
  @title = title
  unless title.nil? # rubocop:disable Style/IfUnlessModifier
    @owner, @name = parse_title(@title)
  end
  @location = DocumentLocation.new
  @resolver_flags = []
end

Instance Attribute Details

#locationObject

The location of the module instantiation in the Puppetfile document

DocumentLocation


26
27
28
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 26

def location
  @location
end

#module_typeObject (readonly)

Returns the value of attribute module_type.



28
29
30
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 28

def module_type
  @module_type
end

#nameObject

The name of the module



19
20
21
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 19

def name
  @name
end

#ownerObject

The owner of the module



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

def owner
  @owner
end

#resolver_flagsArray[Symbol]

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Array of flags that will instruct the resolver to change its default behaviour. Current flags are set out in the PuppetfileResolver::Puppetfile::…_FLAG constants

Returns:

  • (Array[Symbol])

    Array of flags that will instruct the resolver to change its default behaviour



34
35
36
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 34

def resolver_flags
  @resolver_flags
end

#titleObject

The full title of the module



13
14
15
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 13

def title
  @title
end

#versionObject

The version of the module



22
23
24
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 22

def version
  @version
end

Instance Method Details

#to_sObject



45
46
47
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 45

def to_s
  "#{self.class} #{title}-#{name}"
end