Immutable Struct-like record structures based on Hamster.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
rake_tasks
spec
.gitignore
.rspec
.ruby-version
CHANGELOG
Gemfile
README.md
Rakefile
TODO.txt
hamsterdam.gemspec

README.md

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