Class: Syro
- Inherits:
-
Object
- Object
- Syro
- Defined in:
- lib/syro.rb
Defined Under Namespace
Constant Summary collapse
- OVERRIDE =
Method override parameter
"_method".freeze
- PATH_INFO =
HTTP environment variables
"PATH_INFO".freeze
- SCRIPT_NAME =
"SCRIPT_NAME".freeze
- REQUEST_METHOD =
"REQUEST_METHOD".freeze
- LOCATION =
Response headers
"Location".freeze
- CONTENT_TYPE =
"Content-Type".freeze
- CONTENT_LENGTH =
"Content-Length".freeze
- CONTENT_TYPE_DEFAULT =
"text/html".freeze
- GET =
Request methods
'GET'.freeze
- POST =
'POST'.freeze
- PATCH =
'PATCH'.freeze
- DELETE =
'DELETE'.freeze
- METHODS =
Available methods
[GET, POST, PATCH, DELETE].freeze
Instance Method Summary collapse
- #call(env, inbox = {}) ⇒ Object
-
#initialize(&block) ⇒ Syro
constructor
A new instance of Syro.
Constructor Details
#initialize(&block) ⇒ Syro
Returns a new instance of Syro.
250 251 252 |
# File 'lib/syro.rb', line 250 def initialize(&block) @code = block end |
Instance Method Details
#call(env, inbox = {}) ⇒ Object
254 255 256 |
# File 'lib/syro.rb', line 254 def call(env, inbox = {}) Sandbox.new(@code).call(env, inbox) end |