Class: Rack::If

Inherits:
Object
  • Object
show all
Defined in:
lib/rackif.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}, &block) ⇒ If

Returns a new instance of If.



7
8
9
10
11
12
# File 'lib/rackif.rb', line 7

def initialize(app, options={}, &block)
  @options     = options
  @app         = app
  
  @block = block
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



5
6
7
# File 'lib/rackif.rb', line 5

def app
  @app
end

Instance Method Details

#call(rack_environment) ⇒ Object



14
15
16
# File 'lib/rackif.rb', line 14

def call(rack_environment)
  Rack::IfProcessing.new(app,@options, &@block).call(rack_environment)
end