Class: SiteHealth::KeyStruct

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

Instance Method Summary collapse

Constructor Details

#initialize(**keyword_args) ⇒ KeyStruct

Returns a new instance of KeyStruct.



3
4
5
6
7
8
9
10
11
# File 'lib/site_health/key_struct.rb', line 3

def initialize(**keyword_args)
  keyword_args.each do |key, value|
    if members.include?(key)
      self[key] = value
    else
      raise ArgumentError, "Unknown key struct member: #{key}"
    end
  end
end