Skip to content
Tiny template for Hash keys.
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
example Clarify code encodings for Ruby 2.0+
lib/hash Clarify code encodings for Ruby 2.0+
test
.gitignore init
.travis.yml
.yardopts init
Gemfile Clarify code encodings for Ruby 2.0+
MIT-LICENSE init
README.md
Rakefile Clarify code encodings for Ruby 2.0+
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.

Something went wrong with that request. Please try again.