Class: Arbetsformedlingen::KeyStruct

Inherits:
Struct
  • Object
show all
Defined in:
lib/arbetsformedlingen/key_struct.rb

Instance Method Summary collapse

Constructor Details

#initialize(**keyword_args) ⇒ KeyStruct

Returns a new instance of KeyStruct.



5
6
7
8
9
10
11
12
13
# File 'lib/arbetsformedlingen/key_struct.rb', line 5

def initialize(**keyword_args)
  keyword_args.each do |key, value|
    unless members.include?(key)
      raise ArgumentError, "Unknown key struct member: #{key}"
    end

    self[key] = value
  end
end