Skip to content

atomicobject/hamsterdam

Repository files navigation

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")

About

Immutable Struct-like record structures based on Hamster.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages