Class: HammerCLIForeman::Parameter::AbstractParameterCommand
- Inherits:
-
Command
- Object
- HammerCLI::Apipie::Command
- Command
- HammerCLIForeman::Parameter::AbstractParameterCommand
show all
- Defined in:
- lib/hammer_cli_foreman/parameter.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
alias_name_for_resource, build_options, connection_name, #customized_options, #dependency_resolver, dependency_resolver, #exception_handler_class, #get_resource_id, #get_resource_ids, #request_params, resolver, #resolver, resource_alias_name_mapping, resource_config, resource_name_mapping, #searchables, searchables, #send_request, #transform_format
Class Method Details
.create_option_builder ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/hammer_cli_foreman/parameter.rb', line 39
def self.create_option_builder
builder = super
builder.builders = [
DependentSearchablesOptionBuilder.new(resource, searchables)
]
builder
end
|
.parameter_resource ⇒ Object
Instance Method Details
#base_action_params ⇒ Object
33
34
35
36
37
|
# File 'lib/hammer_cli_foreman/parameter.rb', line 33
def base_action_params
{
"#{resource.singular_name}_id" => get_identifier
}
end
|
#get_identifier ⇒ Object
19
20
21
22
|
# File 'lib/hammer_cli_foreman/parameter.rb', line 19
def get_identifier
@identifier ||= get_resource_id(resource, :scoped => true)
@identifier
end
|
#get_parameter_identifier ⇒ Object
24
25
26
27
28
29
30
31
|
# File 'lib/hammer_cli_foreman/parameter.rb', line 24
def get_parameter_identifier
if @parameter_identifier.nil?
opts = all_options
opts[HammerCLI.option_accessor_name("#{resource.singular_name}_id")] ||= get_identifier
@parameter_identifier = resolver.send("#{parameter_resource.singular_name}_id", opts)
end
@parameter_identifier
end
|
#parameter_resource ⇒ Object
15
16
17
|
# File 'lib/hammer_cli_foreman/parameter.rb', line 15
def parameter_resource
self.class.parameter_resource
end
|