vuderacha-activekv 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/activekv/base.rb +6 -0
- metadata +1 -1
data/lib/activekv/base.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'json' rescue nil # This prevents the json gem loading afterwards and messing up the JSON serialisation
|
1
3
|
require 'activesupport'
|
2
4
|
|
3
5
|
module ActiveKV
|
@@ -9,6 +11,10 @@ module ActiveKV
|
|
9
11
|
apply_hash!(config)
|
10
12
|
end
|
11
13
|
|
14
|
+
def to_json(options = {})
|
15
|
+
ActiveSupport::JSON.encode(instance_values, options)
|
16
|
+
end
|
17
|
+
|
12
18
|
# Configures the ActiveKV support with the given configuration file
|
13
19
|
def self.configure(config_file)
|
14
20
|
# Determine our environment
|