Class: HammerCLIKatello::ContentViewComponentBase::ComponentCommand
- Inherits:
-
SingleResourceCommand
- Object
- HammerCLIForeman::SingleResourceCommand
- SingleResourceCommand
- HammerCLIKatello::ContentViewComponentBase::ComponentCommand
- Defined in:
- lib/hammer_cli_katello/content_view_component.rb
Direct Known Subclasses
HammerCLIKatello::ContentViewComponent::RemoveComponents, ComponentUpdateCommand
Instance Method Summary collapse
- #get_component_by_name_or_id(composite_content_view_id, options) ⇒ Object
- #get_components(composite_content_view_id) ⇒ Object
Methods included from HammerCLIKatello::CompositeContentViewNameResolvable
#composite_content_view_resolve_options, included, #options
Methods included from OrganizationOptions
Methods included from ResolverCommons
Instance Method Details
#get_component_by_name_or_id(composite_content_view_id, options) ⇒ Object
14 15 16 17 18 |
# File 'lib/hammer_cli_katello/content_view_component.rb', line 14 def get_component_by_name_or_id(composite_content_view_id, ) get_components(composite_content_view_id).find do |cv| cv["content_view"]["name"] == [:name] || cv["content_view"]["id"] == [:id] end end |
#get_components(composite_content_view_id) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/hammer_cli_katello/content_view_component.rb', line 7 def get_components(composite_content_view_id) = {:composite_content_view_id => composite_content_view_id} components = ::HammerCLIForeman.foreman_resource(:content_view_components).call(:index, ) components["results"] || [] end |