Ruby version: 2.3.1
It does not appear that Ruby Structs can be declared using keyword params. Is there a way to do this within Struct
?
Example:
MyStruct = Struct.new(:fname, :lname)
=> MyStruct
my_struct = MyStruct.new(fname: 'first', lname: 'last')
=> <struct MyStruct fname={:fname=>"first", :lname=>"last"}, lname=nil>
my_struct.fname
=> {:fname=>"first", :lname=>"last"}
my_struct.lname
=> nil