Class: HammerCLIForeman::BuildParams
- Inherits:
-
Object
- Object
- HammerCLIForeman::BuildParams
- Defined in:
- lib/hammer_cli_foreman/option_builders.rb
Defined Under Namespace
Classes: ExpansionParams
Instance Method Summary collapse
- #expand(switch = :all) ⇒ Object
-
#initialize(params = {}) ⇒ BuildParams
constructor
A new instance of BuildParams.
- #to_hash ⇒ Object
- #without(*option_names) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ BuildParams
Returns a new instance of BuildParams.
37 38 39 |
# File 'lib/hammer_cli_foreman/option_builders.rb', line 37 def initialize(params={}) @params = params || {} end |
Instance Method Details
#expand(switch = :all) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/hammer_cli_foreman/option_builders.rb', line 45 def (switch = :all) @expansion ||= ExpansionParams.new(@params[:expand]) if (switch == :none) @expansion.only() end @expansion end |
#to_hash ⇒ Object
53 54 55 56 |
# File 'lib/hammer_cli_foreman/option_builders.rb', line 53 def to_hash @params[:expand] = @expansion.to_hash if @expansion @params end |
#without(*option_names) ⇒ Object
41 42 43 |
# File 'lib/hammer_cli_foreman/option_builders.rb', line 41 def without(*option_names) @params[:without] = option_names end |