Module: Granola

Defined in:
lib/granola.rb,
lib/granola/schema.rb,
lib/granola/caching.rb,
lib/granola/version.rb

Defined Under Namespace

Modules: Caching, Helper, Rack Classes: List, SchemaSerializer, Serializer

Constant Summary collapse

VERSION =
"0.0.4"

Class Attribute Summary collapse

Class Attribute Details

.jsonObject

Public: Get/Set a Proc that takes an Object and a Hash of options and returns a JSON String.

The default implementation uses the standard library's JSON module, but you're welcome to swap it out.

Example:

require "yajl"
Granola.json = ->(obj, **opts) { Yajl::Encoder.encode(obj, opts) }


16
17
18
# File 'lib/granola.rb', line 16

def json
  @json
end