Module: HammerCLIKatello::CompositeContentViewNameResolvable

Included in:
HammerCLIKatello::ContentViewComponent::ListCommand, HammerCLIKatello::ContentViewComponentBase::ComponentCommand
Defined in:
lib/hammer_cli_katello/composite_content_view_name_resolvable.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



22
23
24
25
26
# File 'lib/hammer_cli_katello/composite_content_view_name_resolvable.rb', line 22

def self.included(base)
  base.option "--composite-content-view",
         "COMPOSITE_CONTENT_VIEW_NAME", _("Name of the composite content view"),
         :attribute_name => :option_composite_content_view_name
end

Instance Method Details

#composite_content_view_resolve_options(options) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/hammer_cli_katello/composite_content_view_name_resolvable.rb', line 3

def composite_content_view_resolve_options(options)
  {
    HammerCLI.option_accessor_name("organization_id") => options["option_organization_id"],
    HammerCLI.option_accessor_name("organization_name") => options["option_organization_name"],
    HammerCLI.option_accessor_name("organization_label") =>
      options["option_organization_label"],
    HammerCLI.option_accessor_name("name") => options["option_composite_content_view_name"]
  }
end

#optionsObject



13
14
15
16
17
18
19
20
# File 'lib/hammer_cli_katello/composite_content_view_name_resolvable.rb', line 13

def options
  if super['option_composite_content_view_name'] &&
     super['option_composite_content_view_id'].nil?
    options = composite_content_view_resolve_options(super)
    super['option_composite_content_view_id'] = resolver.content_view_id(options)
  end
  super
end