hash_ish 0.1.0 → 0.2.0

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: 9f5a595a6718786c048cc7ab55cca39aa5505a14
4
- data.tar.gz: 37b0de377ddd57055fdc772183684da2f6fede4e
3
+ metadata.gz: b8cdf984ee41b2b0e954c4f60ebc59a31061238a
4
+ data.tar.gz: 0ff1cdea6e5b2e7a284902d319163609e882e86e
5
5
  SHA512:
6
- metadata.gz: ccc33db8355c8ea20955ff6098cc86eda99c1b663f28f1a476496a3e6642c673e0ba05c32ad646facb22ae2179abffc8adbd2169c16924c58e1eafd5860cdc16
7
- data.tar.gz: 3fd7926103d568d7f18e9c7a5072f14a8f51f6c81bdf52bb89ea03f58716df837d459edb3b66b44e076567922cd36f1d3e9d4e784bc110168812fa10c1842ba2
6
+ metadata.gz: 1ed2106fde81b31c49bbfe7e4c6315a43ca267a8ef9233ce36334e99e42e731efe6f5b89edc26069b33c26395e5111c333baa8a45235c6adf62e39b541e629e4
7
+ data.tar.gz: a0ac9a73f48fd590bd04598d36913720cbbc7115dca46721709b198646d247a523ab3c8b5c2240dbf0c51ba8cee1ea3665882527be02ed63a8e326ed00a4b664
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ ## 0.2.0 (2015-07-22)
2
+
3
+ Features:
4
+ - HashIsh.new now object that descends from Hash
data/README.md CHANGED
@@ -14,17 +14,17 @@ gem install hash_ish
14
14
 
15
15
  ## Usage
16
16
 
17
- 1. Insert hash
18
-
19
- ```
20
- hash = { a { b: "c"} }
21
- hash_ish = HashIsh.new(hash)
22
17
  ```
18
+ require 'hash_ish'
23
19
 
24
- 2. Access hash keys with method calls
20
+ # insert hash into new hash_ish
21
+ hash = { a { b: "c" } }
22
+ hash_ish = HashIsh.new(hash)
25
23
 
26
- ```
24
+ # access hash keys with method calls
27
25
  hash_ish.a.b # returns 'c'
26
+ ```
27
+
28
28
 
29
29
  ## Known issues
30
30
 
@@ -41,4 +41,3 @@ HashIsh.new(123 => 456)
41
41
  ## License
42
42
 
43
43
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
44
-
@@ -1,3 +1,3 @@
1
1
  class HashIsh
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/hash_ish.rb CHANGED
@@ -4,16 +4,20 @@ require 'hash_ish/add_instance_methods'
4
4
  class HashIsh
5
5
  def self.new(kwargs = {})
6
6
  instance(
7
- decorate_klass(kwargs))
7
+ decorate_klass(hash_sub_class, kwargs))
8
+ end
9
+
10
+ def self.decorate_klass(klass, kwargs)
11
+ klass.tap do |klass|
12
+ AddInstanceMethods.new.add(klass, kwargs)
13
+ end
8
14
  end
9
15
 
10
16
  def self.instance(klass)
11
17
  klass.new
12
18
  end
13
19
 
14
- def self.decorate_klass(kwargs)
15
- Class.new.tap do |klass|
16
- AddInstanceMethods.new.add(klass, kwargs)
17
- end
20
+ def self.hash_sub_class
21
+ Class.new(Hash)
18
22
  end
19
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash_ish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Pope
@@ -62,6 +62,7 @@ files:
62
62
  - ".gitignore"
63
63
  - ".rspec"
64
64
  - ".travis.yml"
65
+ - CHANGELOG.md
65
66
  - CODE_OF_CONDUCT.md
66
67
  - Gemfile
67
68
  - LICENSE.txt