kwstruct

Struct with keyword arguments support


Keywords
datastructures, ruby, stdlib
License
MIT
Install
gem install kwstruct -v 0.2.0

Documentation

kwstruct

Just like regular Struct, but uses keyword arguments.

Person = KwStruct.new(:name, :age)
sammy = Person.new(name: 'Sammy', age: 30)

Any non-existent arguments will raise an ArgumentError.

Installation

$ gem install kwstruct

Credits

Thanks @apeiros for ideas.
Thanks @bughit for hitting a bug.