shash 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/shash.rb +9 -9
  2. data/lib/version.rb +1 -1
  3. metadata +1 -1
data/lib/shash.rb CHANGED
@@ -1,15 +1,15 @@
1
- class Shash
2
- attr_reader :hash
1
+ class Shash
2
+ attr_reader :_hash
3
3
 
4
4
  def initialize(hash={})
5
- @hash = hash
5
+ @_hash = hash
6
6
  end
7
7
 
8
8
  def method_missing(key, *args, &block)
9
9
  if key[/=$/]
10
- @hash[key[0...-1]] = args.first
10
+ @_hash[key[0...-1]] = args.first
11
11
  else
12
- if value = @hash[key.to_s]
12
+ if value = @_hash[key.to_s]
13
13
  case value
14
14
  when Hash
15
15
  Shash.new(value)
@@ -17,22 +17,22 @@ class Shash
17
17
  value
18
18
  end
19
19
  else
20
- @hash.send(key, *args, &block)
20
+ @_hash.send(key, *args, &block)
21
21
  end
22
22
  end
23
23
  end
24
24
 
25
25
  def has_key?(key)
26
- @hash.has_key?(key.to_s)
26
+ @_hash.has_key?(key.to_s)
27
27
  end
28
28
  alias_method :key?, :has_key?
29
29
 
30
30
  def ==(other)
31
- @hash == other.hash
31
+ @_hash == other._hash
32
32
  end
33
33
 
34
34
  def []=(key,value)
35
- @hash[key] = value
35
+ @_hash[key] = value
36
36
  end
37
37
  end
38
38
 
data/lib/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  class Shash
2
2
  MAJOR = 0
3
3
  MINOR = 0
4
- BUILD = 3
4
+ BUILD = 4
5
5
 
6
6
  VERSION = "#{MAJOR}.#{MINOR}.#{BUILD}"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: