How do I make a custom initializer for a struct object? This is how I
would expect it to be accomplished (but this does not work):
Dog = Struct.new(:bark, :bite) do
bark = “really loud” unless bark
dd = Dog.new
p dd.bark # => should be “really loud” but is nil
So, structs have no initialize method… I tried some other approaches
but no luck yet. Can anyone figure out how to do this?