Class: HammerCLIForeman::BuildParams

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

Defined Under Namespace

Classes: ExpansionParams

Instance Method Summary collapse

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 expand(switch = :all)
  @expansion ||= ExpansionParams.new(@params[:expand])
  if (switch == :none)
    @expansion.only()
  end
  @expansion
end

#to_hashObject



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