Module: AsJsonEncoder

Defined in:
lib/as_json_encoder.rb,
lib/as_json_encoder/version.rb

Defined Under Namespace

Modules: Cachable Classes: ActiveSupportAdapter, Encoder

Constant Summary collapse

SharedEncoderInstance =
Encoder.new
VERSION =
"0.0.1"

Class Attribute Summary collapse

Class Attribute Details

.cacheObject

The cache to use for storing JSON fragments. This will grow unbounded at runtime, so it should be set to a bounded LRU cache implementation, such as ActiveSupport::Cache::MemoryStore.



14
15
16
# File 'lib/as_json_encoder.rb', line 14

def cache
  @cache
end

.namespaceObject

The namespace to use for the cache keys.



17
18
19
# File 'lib/as_json_encoder.rb', line 17

def namespace
  @namespace
end