Class: HammerCLIForeman::SearchablesUpdateOptionBuilder
- Inherits:
-
SearchablesAbstractOptionBuilder
- Object
- HammerCLI::AbstractOptionBuilder
- SearchablesAbstractOptionBuilder
- HammerCLIForeman::SearchablesUpdateOptionBuilder
- Defined in:
- lib/hammer_cli_foreman/option_builders.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #build(builder_params = {}) ⇒ Object
-
#initialize(resource, searchables) ⇒ SearchablesUpdateOptionBuilder
constructor
A new instance of SearchablesUpdateOptionBuilder.
Constructor Details
#initialize(resource, searchables) ⇒ SearchablesUpdateOptionBuilder
Returns a new instance of SearchablesUpdateOptionBuilder.
397 398 399 400 |
# File 'lib/hammer_cli_foreman/option_builders.rb', line 397 def initialize(resource, searchables) @resource = resource @searchables = searchables end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
402 403 404 |
# File 'lib/hammer_cli_foreman/option_builders.rb', line 402 def resource @resource end |
Instance Method Details
#build(builder_params = {}) ⇒ Object
404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/hammer_cli_foreman/option_builders.rb', line 404 def build(builder_params={}) @searchables.for(@resource).collect do |s| if s.editable? option( optionamize("--new-#{s.name}"), "NEW_#{s.name.upcase}", description(s.name, :update) ) end end.compact end |