Class: HammerCLIForeman::IdOptionBuilder
- Inherits:
-
SearchablesAbstractOptionBuilder
- Object
- HammerCLI::AbstractOptionBuilder
- SearchablesAbstractOptionBuilder
- HammerCLIForeman::IdOptionBuilder
- 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
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #build(builder_params = {}) ⇒ Object
-
#initialize(resource) ⇒ IdOptionBuilder
constructor
A new instance of IdOptionBuilder.
Constructor Details
#initialize(resource) ⇒ IdOptionBuilder
Returns a new instance of IdOptionBuilder.
422 423 424 |
# File 'lib/hammer_cli_foreman/option_builders.rb', line 422 def initialize(resource) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
426 427 428 |
# File 'lib/hammer_cli_foreman/option_builders.rb', line 426 def resource @resource end |
Instance Method Details
#build(builder_params = {}) ⇒ Object
428 429 430 431 432 |
# File 'lib/hammer_cli_foreman/option_builders.rb', line 428 def build(builder_params={}) [ option("--id", "ID", description("id", :show), :referenced_resource => @resource.singular_name) ] end |