Class: HammerCLIKatello::ContentViewComponent::RemoveComponents
Instance Method Summary
collapse
#get_component_by_name_or_id, #get_components
#composite_content_view_resolve_options, included, #options
included, #org_options
included
Instance Method Details
#component_content_view_ids ⇒ Object
199
200
201
202
|
# File 'lib/hammer_cli_katello/content_view_component.rb', line 199
def component_content_view_ids
return [] unless option_component_content_view_ids
option_component_content_view_ids.split(",").map(&:strip)
end
|
#component_content_view_names ⇒ Object
194
195
196
197
|
# File 'lib/hammer_cli_katello/content_view_component.rb', line 194
def component_content_view_names
return [] unless option_component_content_view_names
option_component_content_view_names.split(",").map(&:strip)
end
|
#request_params ⇒ Object
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
# File 'lib/hammer_cli_katello/content_view_component.rb', line 204
def request_params
super.tap do |opts|
if option_component_content_view_names || option_component_content_view_ids
component_cv_names = component_content_view_names
component_cv_ids = component_content_view_ids
component_ids = opts["component_ids"] || []
components = get_components(opts["composite_content_view_id"])
components.each do |comp|
if component_cv_names.include?(comp["content_view"]["name"]) ||
component_cv_ids.include?(comp["content_view"]["id"].to_s)
component_ids << comp["id"]
end
end
opts["component_ids"] = component_ids.uniq
end
end
end
|