Class: ForemanDeployments::Inputs::Value
- Inherits:
-
BaseInputDefinition
- Object
- BaseInputDefinition
- ForemanDeployments::Inputs::Value
- Defined in:
- app/lib/foreman_deployments/inputs/value.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
Instance Method Summary collapse
- #configured ⇒ Object
-
#initialize(params = {}) ⇒ Value
constructor
A new instance of Value.
- #to_hash ⇒ Object
Methods inherited from BaseInputDefinition
build, #configuration, #configure, tag_name, #validate
Constructor Details
#initialize(params = {}) ⇒ Value
Returns a new instance of Value.
6 7 8 9 10 |
# File 'app/lib/foreman_deployments/inputs/value.rb', line 6 def initialize(params = {}) @description = params.delete('description') @default = params.delete('default') super end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'app/lib/foreman_deployments/inputs/value.rb', line 4 def description @description end |
Instance Method Details
#configured ⇒ Object
12 13 14 |
# File 'app/lib/foreman_deployments/inputs/value.rb', line 12 def configured @configured || @default end |
#to_hash ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/lib/foreman_deployments/inputs/value.rb', line 16 def to_hash super.merge( 'description' => @description, 'default' => @default, 'value' => @configured ) end |