Module: LIFX::RequiredKeywordArguments

Included in:
Client, Light, LightCollection, NetworkContext
Defined in:
lib/lifx/required_keyword_arguments.rb

Instance Method Summary collapse

Instance Method Details

#required!(name) ⇒ Object



3
4
5
6
7
8
# File 'lib/lifx/required_keyword_arguments.rb', line 3

def required!(name)
  backtrace = caller_locations(1).map { |c| c.to_s }
  ex = ArgumentError.new("Missing required keyword argument '#{name}'")
  ex.set_backtrace(backtrace)
  raise ex
end