hash_with_key_access_method 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5f598680b44de693828489f51689cc77d7c8f21
4
- data.tar.gz: b730b930b9f6f85f5aec4c5bd497055d1b322c7b
3
+ metadata.gz: 3b5d97ad590b62ef45924d050d3b16e880a463c6
4
+ data.tar.gz: 654f55ab1687d982ee7d9b0bb4900e49913af02c
5
5
  SHA512:
6
- metadata.gz: c06c950fbc90e00975632c92c9cc889cc4ebb73bc678aa4aceb0d154e1963b5c482ccd93d9213b2c4ca3c53dd2e4925992542edf2a7c3687a389d5a07b00d590
7
- data.tar.gz: d6d0d5b6a3f4199e46fae5b1ca10d2a81ba6905edae5e97b680296bf4ff407a3f0dec2487e06db73b0256de43ebf4d72ae2a92d72482c3fc443c1b6fab06f43b
6
+ metadata.gz: a6d207dd2fab89f7d7a9391f159a9ff5b085ad51c395b59bf97739dcf04eaf2dbb35b75b62b8c541ac9c6dbb387676c4e317394732cdd21e8887e73cfd163cbf
7
+ data.tar.gz: 28bed2c5f08db9b64504e6c0f37543c43f5414a4c5a3b757a0a2fcae1ac73fc70d0a5e0fba6b0a6b3c3717198b187d28301fea711b149e5af051a1761a2cc59b
data/README.md CHANGED
@@ -19,6 +19,9 @@ Or install it yourself as:
19
19
  ## Usage
20
20
 
21
21
  ```ruby
22
+ # Using refinements
23
+ using HashWithKeyAccessMethod
24
+
22
25
  hash = { name: :homu, "name2" => :mami}
23
26
 
24
27
  hash.name # to hash[:name]
@@ -38,6 +41,14 @@ hash.age
38
41
  # => 13
39
42
  hash[:age]
40
43
  # => 13
44
+
45
+
46
+ # Use included Hash.
47
+ require "hash_with_key_access_method/included"
48
+
49
+ hashs = [{name: :homu}, {name: :mami}, {name: :mado}]
50
+ hashs.map &:name
51
+ # => [:homu, :mami, :mado]
41
52
  ```
42
53
 
43
54
  ## Contributing
@@ -0,0 +1 @@
1
+ require "hash_with_key_access_method/included/hash"
@@ -0,0 +1,5 @@
1
+ require "hash_with_key_access_method"
2
+
3
+ class Hash
4
+ include HashWithKeyAccessMethod
5
+ end
@@ -1,3 +1,3 @@
1
1
  module HashWithKeyAccessMethod
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash_with_key_access_method
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - manga_osyo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-05 00:00:00.000000000 Z
11
+ date: 2015-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,6 +68,8 @@ files:
68
68
  - Rakefile
69
69
  - hash_with_key_access_method.gemspec
70
70
  - lib/hash_with_key_access_method.rb
71
+ - lib/hash_with_key_access_method/included.rb
72
+ - lib/hash_with_key_access_method/included/hash.rb
71
73
  - lib/hash_with_key_access_method/version.rb
72
74
  - spec/hash_with_key_access_method_spec.rb
73
75
  - spec/spec_helper.rb