hash-proxy 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,6 +2,8 @@
2
2
  *.rbc
3
3
  .bundle
4
4
  .config
5
+ .specification
6
+ hash-proxy.gemspec
5
7
  coverage
6
8
  InstalledFiles
7
9
  lib/bundler/man
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ # == Version 0.1.4 / 2012-11-07
2
+ # * Support serialization
3
+ #
1
4
  # == Version 0.1.3 / 2012-08-13
2
5
  # * Support to_ary method on NullObject
3
6
  #
@@ -12,6 +12,17 @@ module HashProxy
12
12
  # Used to check if a setter is being called
13
13
  EQUALS = '='.freeze
14
14
 
15
+ # Serialization
16
+ def marshal_dump
17
+ [@hash, @converted]
18
+ end
19
+
20
+ # Deserialization
21
+ def marshal_load(array)
22
+ @hash = array[0]
23
+ @converted = array[1]
24
+ end
25
+
15
26
  # Create a hashProxy::Proxy object from the provided Hash.
16
27
  #
17
28
  # @param [Hash] hash The hash we are proxying
@@ -103,7 +114,7 @@ module HashProxy
103
114
  def respond_to?(method)
104
115
  method_name = method.to_s
105
116
  method_name.gsub(/=$/, '')
106
- (@hash.keys.map(&:to_s) + @converted.keys.map(&:to_s)).include?(method_name) || super
117
+ (@hash && @converted && (@hash.keys.map(&:to_s) + @converted.keys.map(&:to_s)).include?(method_name)) || super
107
118
  end
108
119
 
109
120
  # Converts an arbitrary object as follows:
data/version.txt CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-13 00:00:00.000000000 Z
12
+ date: 2012-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bones