Class: PuppetfileResolver::Puppetfile::BaseModule
- Inherits:
-
Object
- Object
- PuppetfileResolver::Puppetfile::BaseModule
- Defined in:
- lib/puppetfile-resolver/puppetfile/base_module.rb
Direct Known Subclasses
ForgeModule, GitModule, InvalidModule, LocalModule, SvnModule
Instance Attribute Summary collapse
-
#location ⇒ Object
The location of the module instantiation in the Puppetfile document [DocumentLocation].
-
#module_type ⇒ Object
readonly
Returns the value of attribute module_type.
-
#name ⇒ Object
The name of the module.
-
#owner ⇒ Object
The owner of the module.
-
#resolver_flags ⇒ Array[Symbol]
private
Array of flags that will instruct the resolver to change its default behaviour.
-
#title ⇒ Object
The full title of the module.
-
#version ⇒ Object
The version of the module.
Instance Method Summary collapse
-
#initialize(title) ⇒ BaseModule
constructor
A new instance of BaseModule.
- #to_s ⇒ Object
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
#location ⇒ Object
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_type ⇒ Object (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 |
#name ⇒ Object
The name of the module
19 20 21 |
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 19 def name @name end |
#owner ⇒ Object
The owner of the module
16 17 18 |
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 16 def owner @owner end |
#resolver_flags ⇒ Array[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
34 35 36 |
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 34 def resolver_flags @resolver_flags end |
#title ⇒ Object
The full title of the module
13 14 15 |
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 13 def title @title end |
#version ⇒ Object
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_s ⇒ Object
45 46 47 |
# File 'lib/puppetfile-resolver/puppetfile/base_module.rb', line 45 def to_s "#{self.class} #{title}-#{name}" end |