Class: Fig::Package::Include
- Inherits:
-
Object
- Object
- Fig::Package::Include
- Includes:
- Statement
- Defined in:
- lib/fig/package/include.rb
Overview
Dual role: “include :configname” incorporates one configuration into another; “include package” declares a dependency upon another package.
Instance Attribute Summary collapse
-
#config_name ⇒ Object
readonly
Returns the value of attribute config_name.
-
#overrides ⇒ Object
readonly
Returns the value of attribute overrides.
-
#package_name ⇒ Object
readonly
Returns the value of attribute package_name.
-
#version_name ⇒ Object
readonly
Returns the value of attribute version_name.
Instance Method Summary collapse
-
#initialize(package_name, config_name, version_name, overrides) ⇒ Include
constructor
A new instance of Include.
- #unparse(indent) ⇒ Object
Methods included from Statement
Constructor Details
#initialize(package_name, config_name, version_name, overrides) ⇒ Include
Returns a new instance of Include.
15 16 17 18 19 20 |
# File 'lib/fig/package/include.rb', line 15 def initialize(package_name, config_name, version_name, overrides) @package_name = package_name @config_name = config_name @version_name = version_name @overrides = overrides end |
Instance Attribute Details
#config_name ⇒ Object (readonly)
Returns the value of attribute config_name.
13 14 15 |
# File 'lib/fig/package/include.rb', line 13 def config_name @config_name end |
#overrides ⇒ Object (readonly)
Returns the value of attribute overrides.
13 14 15 |
# File 'lib/fig/package/include.rb', line 13 def overrides @overrides end |
#package_name ⇒ Object (readonly)
Returns the value of attribute package_name.
13 14 15 |
# File 'lib/fig/package/include.rb', line 13 def package_name @package_name end |
#version_name ⇒ Object (readonly)
Returns the value of attribute version_name.
13 14 15 |
# File 'lib/fig/package/include.rb', line 13 def version_name @version_name end |
Instance Method Details
#unparse(indent) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fig/package/include.rb', line 22 def unparse(indent) descriptor = '' descriptor += @package_name if @package_name descriptor += "/#{@version_name}" if @version_name descriptor += ":#{@config_name}" if @config_name @overrides.each do |override| descriptor += override.unparse end return "#{indent}include #{descriptor}" end |