Class: Generamba::TemplateDeclaration
- Inherits:
-
Object
- Object
- Generamba::TemplateDeclaration
- Defined in:
- lib/generamba/template/processor/template_declaration.rb
Overview
Describes a Generamba template declaration model
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#local ⇒ Object
readonly
Returns the value of attribute local.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(template_hash) ⇒ TemplateDeclaration
constructor
A new instance of TemplateDeclaration.
- #install(strategy) ⇒ Object
Constructor Details
#initialize(template_hash) ⇒ TemplateDeclaration
Returns a new instance of TemplateDeclaration.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/generamba/template/processor/template_declaration.rb', line 20 def initialize(template_hash) @name = template_hash[TEMPLATE_DECLARATION_NAME_KEY] @local = template_hash[TEMPLATE_DECLARATION_LOCAL_KEY] @git = template_hash[TEMPLATE_DECLARATION_GIT_KEY] @branch = template_hash[TEMPLATE_DECLARATION_BRANCH_KEY] @type = TemplateDeclarationType::LOCAL_TEMPLATE if @local @type = TemplateDeclarationType::REMOTE_TEMPLATE if @git @type = TemplateDeclarationType::CATALOG_TEMPLATE if @git == nil && @local == nil end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
18 19 20 |
# File 'lib/generamba/template/processor/template_declaration.rb', line 18 def branch @branch end |
#git ⇒ Object (readonly)
Returns the value of attribute git.
18 19 20 |
# File 'lib/generamba/template/processor/template_declaration.rb', line 18 def git @git end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
18 19 20 |
# File 'lib/generamba/template/processor/template_declaration.rb', line 18 def local @local end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
18 19 20 |
# File 'lib/generamba/template/processor/template_declaration.rb', line 18 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
18 19 20 |
# File 'lib/generamba/template/processor/template_declaration.rb', line 18 def type @type end |
Instance Method Details
#install(strategy) ⇒ Object
31 32 33 |
# File 'lib/generamba/template/processor/template_declaration.rb', line 31 def install(strategy) strategy.install_template(self) end |