hash-dot 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/hash-dot.rb +12 -0
  3. metadata +45 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b0e7419a1a08a18fa9acc86a21a4ab01ddda41da
4
+ data.tar.gz: 5ff826e3ddc5464517fb95a7c0b05724ed39176e
5
+ SHA512:
6
+ metadata.gz: 2c48053d7d939dc666124131e573c9dec5c9adfe817f39744f59d78f13b9c1732a0b1cd6e24316fdad85fd07d7d1079d26959d7e992b33d44236e34926c50200
7
+ data.tar.gz: 1a01c2b19a9c2a1f22a013e5ef120e523a4ff9f798cb800a43b2e4b31702c78fa8f66dea2ace7a00ebb64d36b74a078883253cd87ebea49e695d1f79d1663d89
@@ -0,0 +1,12 @@
1
+ class Hash
2
+ def method_missing(method, *opts)
3
+ m = method.to_s
4
+ msym = m.to_sym
5
+ if self.has_key?(m)
6
+ return self[m]
7
+ elsif self.has_key?(msym)
8
+ return self[msym]
9
+ end
10
+ super
11
+ end
12
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hash-dot
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ben Porter
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Adds the JavaScript dot notation for accessing hash keys to ruby, so
14
+ you can do my_hash.key1
15
+ email: BenjaminPorter86@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/hash-dot.rb
21
+ homepage: http://rubygems.org/gems/hash-dot
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.4.5
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Adds the JavaScript hash syntax to ruby
45
+ test_files: []