Skip to content
Immutable Struct-like record structures based on Hamster.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
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")
You can’t perform that action at this time.