Module: LIFX::LAN::RequiredKeywordArguments

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

Instance Method Summary collapse

Instance Method Details

#required!(name) ⇒ Object



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

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