hashdot 0.1.0

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/hashdot.rb +14 -0
  3. metadata +61 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: df5458980f2a95f905458bc75c33b92f820bbe23
4
+ data.tar.gz: db236857e37309127f919fdcf67cbdf31673a4e1
5
+ SHA512:
6
+ metadata.gz: 27199c46f43b96cf558bc14320c0442b4a258bd881c8b2c7962bb622127c9117d4e6988c2ea8ca0b4f8a36301b0e0eb42985226fff2e9548410af040685f00a9
7
+ data.tar.gz: 17ab900036bc48ab441c1c238e8ce8441f0667fbf94b63c0906869ad362046e9bdb27399cf1804d6a8079b05caeb8a4f561d916b90d206a6a11c376721c323fb
data/lib/hashdot.rb ADDED
@@ -0,0 +1,14 @@
1
+ class Hash
2
+ def method_missing(method_name, *arguments, &block)
3
+ super unless self.has_key?(method_name) || self.has_key?(method_name.to_s)
4
+
5
+ case
6
+ when has_key?(method_name)
7
+ fetch(method_name)
8
+ when has_key?(method_name.to_s)
9
+ fetch(method_name.to_s)
10
+ else
11
+ raise 'Something remarkably weird has happened here'
12
+ end
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hashdot
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Pablo Astigrraga
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cutest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: "\n Hashdot provides a nice JavaScript/Lua-style accessor for each
28
+ key in your hash without much fuzz\n "
29
+ email:
30
+ - pote@tardis.com.uy
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - lib/hashdot.rb
36
+ homepage: http://github.com/pote/hashdot
37
+ licenses:
38
+ - MIT
39
+ metadata: {}
40
+ post_install_message:
41
+ rdoc_options: []
42
+ require_paths:
43
+ - lib
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ requirements: []
56
+ rubyforge_project:
57
+ rubygems_version: 2.2.2
58
+ signing_key:
59
+ specification_version: 4
60
+ summary: Nicer accessors for hashes
61
+ test_files: []