Tiny template for Hash keys.
Ruby
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
lib/hash
test
.gitignore
.travis.yml
.yardopts
Gemfile
MIT-LICENSE
README.md
Rakefile
hash-keyable.gemspec

README.md

hash-keyable

Build Status Gem Version

Description

Tiny template for Hash keys.

Features

  • Pure Ruby :)

Usage

Overview

require 'hash/keyable'

class FooBar
  include Hash::Keyable
  
  attr_accessor :var
end

foo = FooBar.new
bar = FooBar.new

HASH = {foo => :value}

p HASH.key? bar #=> true

foo.var = 'foo'
bar.var = 'bar'

p HASH.key? bar #=> false

bar.var = 'foo'

p HASH.key? bar #=> false

HASH.rehash

p HASH.key? bar #=> true

Requirements

Install

gem install hash-keyable

Link

License

The MIT X11 License
Copyright (c) 2012 Kenichi Kamiya
See MIT-LICENSE for further details.