Class: Jellyfish::Sinatra
- Inherits:
-
Controller
- Object
- Controller
- Jellyfish::Sinatra
- Defined in:
- lib/jellyfish/sinatra.rb
Constant Summary
Constants included from Jellyfish
LOCATION, PATH_INFO, RACK_ERRORS, REQUEST_METHOD, VERSION
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Attributes inherited from Controller
Instance Method Summary collapse
Methods inherited from Controller
#body, #call, #forward, #found, #headers_merge, #initialize, #path_info, #request_method
Methods included from Jellyfish
#call, #controller, #initialize, #protect
Constructor Details
This class inherits a constructor from Jellyfish::Controller
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
7 8 9 |
# File 'lib/jellyfish/sinatra.rb', line 7 def params @params end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
7 8 9 |
# File 'lib/jellyfish/sinatra.rb', line 7 def request @request end |
Instance Method Details
#block_call(argument, block) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/jellyfish/sinatra.rb', line 8 def block_call argument, block @request = Rack::Request.new(env) @params = indifferent_params(if argument.kind_of?(MatchData) then # merge captured data from matcher into params as sinatra request.params.merge(Hash[argument.names.zip(argument.captures)]) else request.params end) super end |