Project

hamsterdam

0.02
No commit activity in last 3 years
No release in over 3 years
Immutable Struct-like record structures based on Hamster.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0

Runtime

>= 3.0
 Project Readme

Hamsterdam

Immutable Struct-like record structures based on Hamster's (https://github.com/harukizaemon/hamster) immutable Hashes. Convenient methods for updating record structures and returning new immutable instances.

Example

Person = Hamsterdam::Struct.define(:name, :address, :age)
david = Person.new(name: "David", age: true, address: "Coopersville")
david1 = david.set_address("East Grand Rapids")
david2 = david.merge(name: "Crosby", age: "increased")