vuderacha-activekv 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.
- 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
|