diff options
author | Florian Frank <flori@ping.de> | 2012-04-18 10:30:51 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2012-04-27 20:24:10 +0200 |
commit | c6801b66951c83344d6f10029ae9b6958a12def7 (patch) | |
tree | 3471218335db3cec809aacbcfef2ceff8e052c09 /lib | |
parent | f7ed2c6b0b54e6fc04d58b38d9639cbef5ee6255 (diff) | |
download | json-c6801b66951c83344d6f10029ae9b6958a12def7.tar.gz |
Add implementation for a light object
Diffstat (limited to 'lib')
-rw-r--r-- | lib/json/light_object.rb | 10 | ||||
-rw-r--r-- | lib/json/version.rb | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/json/light_object.rb b/lib/json/light_object.rb index 69dd5ab..07eeecf 100644 --- a/lib/json/light_object.rb +++ b/lib/json/light_object.rb @@ -13,7 +13,15 @@ module JSON end def to_hash - __send__ :table + table + end + + def [](name) + to_hash[name.to_sym] + end + + def []=(name, value) + modifiable[name.to_sym] = value end def |(other) diff --git a/lib/json/version.rb b/lib/json/version.rb index 63ebcf3..c27628e 100644 --- a/lib/json/version.rb +++ b/lib/json/version.rb @@ -1,6 +1,6 @@ module JSON # JSON version - VERSION = '1.6.6' + VERSION = '1.7.0' VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc: VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc: VERSION_MINOR = VERSION_ARRAY[1] # :nodoc: |