Module: RestGraph::YajlRuby

Defined in:
lib/rest-graph/core.rb

Overview

begin json backend adapter

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(mod) ⇒ Object



129
130
131
# File 'lib/rest-graph/core.rb', line 129

def self.extended mod
  mod.const_set(:ParseError, Yajl::ParseError)
end

Instance Method Details

#json_decode(json) ⇒ Object



135
136
137
# File 'lib/rest-graph/core.rb', line 135

def json_decode json
  Yajl::Parser.parse(json)
end

#json_encode(hash) ⇒ Object



132
133
134
# File 'lib/rest-graph/core.rb', line 132

def json_encode hash
  Yajl::Encoder.encode(hash)
end