Module: Nymphia::DSL::Context::HostContextMethods

Included in:
DefaultParams, Host
Defined in:
lib/nymphia/dsl/context/host_context_methods.rb

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *params) ⇒ Object (private)



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/nymphia/dsl/context/host_context_methods.rb', line 12

def method_missing(method, *params)
  key = camelize(method.to_s)

  if @default_params && @default_params[key]
    @result[:contents][key] = Array(params[0])
    @default_params.delete(key)
  end

  if @result[:contents][key]
    @result[:contents][key] << params[0]
  else
    @result[:contents][key] = Array(params[0])
  end
end