Class: HammerCLIForeman::DependentSearchablesOptionBuilder

Inherits:
SearchablesAbstractOptionBuilder show all
Defined in:
lib/hammer_cli_foreman/option_builders.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource, searchables, options = {}) ⇒ DependentSearchablesOptionBuilder

Returns a new instance of DependentSearchablesOptionBuilder.



205
206
207
208
209
# File 'lib/hammer_cli_foreman/option_builders.rb', line 205

def initialize(resource, searchables, options = {})
  @resource = resource
  @searchables = searchables
  @context = options[:context] || {}
end

Instance Attribute Details

#resourceObject (readonly)

Returns the value of attribute resource.



211
212
213
# File 'lib/hammer_cli_foreman/option_builders.rb', line 211

def resource
  @resource
end

Instance Method Details

#build(builder_params = {}) ⇒ Object



213
214
215
216
217
# File 'lib/hammer_cli_foreman/option_builders.rb', line 213

def build(builder_params={})
  resource_name_map = builder_params[:resource_mapping] || {}
  command = builder_params[:command]
  dependent_options(@resource, resource_name_map, command)
end