Class: ForemanRemoteExecution::ProviderInput

Inherits:
Object
  • Object
show all
Defined in:
app/lib/foreman_remote_execution/provider_input.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, label:, value:, description: nil, options: nil, value_type: nil, required: false, hidden: false) ⇒ ProviderInput

Returns a new instance of ProviderInput.



6
7
8
9
10
11
12
13
14
15
# File 'app/lib/foreman_remote_execution/provider_input.rb', line 6

def initialize(name:, label:, value:, description: nil, options: nil, value_type: nil, required: false, hidden: false)
  @name = name
  @label = label
  @value = value
  @description = description
  @options = options
  @value_type = value_type
  @required = required
  @hidden = hidden
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



3
4
5
# File 'app/lib/foreman_remote_execution/provider_input.rb', line 3

def description
  @description
end

#labelObject (readonly)

Returns the value of attribute label.



3
4
5
# File 'app/lib/foreman_remote_execution/provider_input.rb', line 3

def label
  @label
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'app/lib/foreman_remote_execution/provider_input.rb', line 3

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'app/lib/foreman_remote_execution/provider_input.rb', line 3

def options
  @options
end

#requiredObject (readonly)

Returns the value of attribute required.



3
4
5
# File 'app/lib/foreman_remote_execution/provider_input.rb', line 3

def required
  @required
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'app/lib/foreman_remote_execution/provider_input.rb', line 4

def value
  @value
end

#value_typeObject (readonly)

Returns the value of attribute value_type.



3
4
5
# File 'app/lib/foreman_remote_execution/provider_input.rb', line 3

def value_type
  @value_type
end

Instance Method Details

#hidden_value?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/lib/foreman_remote_execution/provider_input.rb', line 21

def hidden_value?
  @hidden
end

#options_arrayObject



25
26
27
# File 'app/lib/foreman_remote_execution/provider_input.rb', line 25

def options_array
  options.blank? ? [] : options.split(/\r?\n/).map(&:strip)
end

#template_inputObject



17
18
19
# File 'app/lib/foreman_remote_execution/provider_input.rb', line 17

def template_input
  self
end