Skip to content

egoholic/typed_map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypedMap

TypedMap is a Hash with typed keys and values.

Installation

Add this line to your application's Gemfile:

gem 'typed_map'

And then execute:

$ bundle

Or install it yourself as:

$ gem install typed_map

Usage

TypedMap is a very simple data structure. It provides only 4 methods that are described below:

pathes = TypedMap.new ktype: Symbol, vtype: String

pathes.add :root, "/"
pathes.add "key", "val" # Error
pathes.add :key, :val   # Error

pathes.has? :root # => true
pathes.keys       # => [:root]
pathes[:root]     # => "/"

Contributing

  1. Fork it ( https://github.com/[my-github-username]/typed_map/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

TypedMap is a Hash with typed keys and values.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages