Class: HammerCLIForeman::IdOptionBuilder

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

Overview

it adds id with description of the id param from resource’s show action

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ IdOptionBuilder

Returns a new instance of IdOptionBuilder.



409
410
411
# File 'lib/hammer_cli_foreman/option_builders.rb', line 409

def initialize(resource)
  @resource = resource
end

Instance Attribute Details

#resourceObject (readonly)

Returns the value of attribute resource.



413
414
415
# File 'lib/hammer_cli_foreman/option_builders.rb', line 413

def resource
  @resource
end

Instance Method Details

#build(builder_params = {}) ⇒ Object



415
416
417
418
419
# File 'lib/hammer_cli_foreman/option_builders.rb', line 415

def build(builder_params={})
  [
    option("--id", "ID", description("id", :show), :referenced_resource => @resource.singular_name)
  ]
end