Module: Rufus::Sixjo
- Defined in:
- lib/rufus/sixjo.rb
Defined Under Namespace
Modules: Erb Classes: App, Context, Route
Constant Summary collapse
- VERSION =
'0.1.1'
Instance Method Summary collapse
-
#configure(*envs, &block) ⇒ Object
Code in the ‘configure’ block will be run inside the application instance.
-
#helpers(&block) ⇒ Object
for example :.
-
#new_sixjo_rack_app(next_app, options = {}) ⇒ Object
Packages the routing info into a Rack application, suitable for insertion into a Rack app chain.
Instance Method Details
#configure(*envs, &block) ⇒ Object
Code in the ‘configure’ block will be run inside the application instance.
398 399 400 401 |
# File 'lib/rufus/sixjo.rb', line 398 def configure (*envs, &block) (@configures ||= []) << [ envs.collect { |e| e.to_s }, block ] end |
#helpers(&block) ⇒ Object
for example :
helpers do
def hello
"hello #{params['who']}"
end
end
389 390 391 392 |
# File 'lib/rufus/sixjo.rb', line 389 def helpers (&block) (@helpers ||= []) << block end |
#new_sixjo_rack_app(next_app, options = {}) ⇒ Object
Packages the routing info into a Rack application, suitable for insertion into a Rack app chain.
Returns an instance of Rufus::Sixjo::App
409 410 411 412 |
# File 'lib/rufus/sixjo.rb', line 409 def new_sixjo_rack_app (next_app, ={}) App.new(next_app, @routes, @helpers, @configures, ) end |