Class: SimpleJSON
- Inherits:
-
Object
- Object
- SimpleJSON
- Defined in:
- lib/simple_json.rb,
lib/simple_json_helpers.rb,
lib/simple_json_bootstrap.rb
Overview
///////////////////////////////////////////////////////////////////////////////////////
- Author
-
lp ([email protected])
- Copyright
-
2009 Louis-Philippe Perron - Released under the terms of the MIT license
:title:SimpleJSON
Defined Under Namespace
Modules: Body, Bootstrap, CrashProof, Request, Response
Class Method Summary collapse
- .add(opts = nil) ⇒ Object
- .bootstrap(opts) ⇒ Object
- .delete(opts = nil) ⇒ Object
- .echo(opts = nil) ⇒ Object
- .get(opts = nil) ⇒ Object
- .query(opts = nil) ⇒ Object
- .rack_mock(m, data, opts = nil) ⇒ Object
- .set(opts = nil) ⇒ Object
Class Method Details
.add(opts = nil) ⇒ Object
20 21 22 |
# File 'lib/simple_json.rb', line 20 def self.add(opts=nil) lambda { |env| CrashProof.wrap { Bootstrap.config(opts); Response.generate( @@store.add( Request.parse( Body.get(env)))) }} end |
.bootstrap(opts) ⇒ Object
2 3 4 |
# File 'lib/simple_json_bootstrap.rb', line 2 def self.bootstrap(opts) Bootstrap.config(opts) end |
.delete(opts = nil) ⇒ Object
24 25 26 |
# File 'lib/simple_json.rb', line 24 def self.delete(opts=nil) lambda { |env| CrashProof.wrap { Bootstrap.config(opts); Response.generate( @@store.delete( Request.parse( Body.get(env)))) }} end |
.echo(opts = nil) ⇒ Object
12 13 14 |
# File 'lib/simple_json.rb', line 12 def self.echo(opts=nil) lambda { |env| CrashProof.wrap { Bootstrap.config(opts); Response.generate( Request.parse( Body.get(env))) }} end |
.get(opts = nil) ⇒ Object
28 29 30 |
# File 'lib/simple_json.rb', line 28 def self.get(opts=nil) lambda { |env| CrashProof.wrap { Bootstrap.config(opts); Response.generate( @@store.get( Request.parse( Body.get(env)))) }} end |
.query(opts = nil) ⇒ Object
32 33 34 |
# File 'lib/simple_json.rb', line 32 def self.query(opts=nil) lambda { |env| CrashProof.wrap { Bootstrap.config(opts); Response.generate( @@store.query( Request.parse( Body.get(env)))) }} end |