Class: Rack::Rewrite::Action::Set
- Inherits:
-
Rack::Rewrite::Action
- Object
- Rack::Rewrite::Action
- Rack::Rewrite::Action::Set
- Defined in:
- lib/rack_rewrite/actions.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(variable, action) ⇒ Set
constructor
A new instance of Set.
Methods inherited from Rack::Rewrite::Action
#method_missing, #query_string=, #respond_to?, #scheme=, #setup
Constructor Details
#initialize(variable, action) ⇒ Set
Returns a new instance of Set.
52 53 54 55 |
# File 'lib/rack_rewrite/actions.rb', line 52 def initialize(variable, action) @variable = variable @action = action end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Rack::Rewrite::Action
Instance Method Details
#call(env) ⇒ Object
57 58 59 60 61 |
# File 'lib/rack_rewrite/actions.rb', line 57 def call(env) setup(env) self.send(:"#{@variable}=", instance_eval(&@action)) env end |