fattr
fattr copied to clipboard
More scaffolding.
I have a very similar gem at https://github.com/johnmcconnell/attr_init. My goal is to slowly integrate with fattr functionality.
However, if you guys are open to it. I can add the functionality to the fattr gem. It is essentially have a class method accessor_struct
, which templates the initializer and to_hash method.
class A
accessor_struct :a, :b
end
a = A.new(a: 1, b: 2)
a.to_hash #=> {'a'=>1,'b'=>2}
hello @ahoward ?