Class: Lego::Controller::ActionContext
- Inherits:
-
Object
- Object
- Lego::Controller::ActionContext
- Defined in:
- lib/lego/controller/action_context.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
-
#match_data ⇒ Object
Returns the value of attribute match_data.
-
#response ⇒ Object
Returns the value of attribute response.
-
#route ⇒ Object
Returns the value of attribute route.
Instance Method Summary collapse
-
#initialize ⇒ ActionContext
constructor
A new instance of ActionContext.
- #options(key) ⇒ Object
- #run(match_data) ⇒ Object
Constructor Details
#initialize ⇒ ActionContext
Returns a new instance of ActionContext.
8 9 10 |
# File 'lib/lego/controller/action_context.rb', line 8 def initialize setup_defaults end |
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
6 7 8 |
# File 'lib/lego/controller/action_context.rb', line 6 def env @env end |
#match_data ⇒ Object
Returns the value of attribute match_data.
6 7 8 |
# File 'lib/lego/controller/action_context.rb', line 6 def match_data @match_data end |
#response ⇒ Object
Returns the value of attribute response.
6 7 8 |
# File 'lib/lego/controller/action_context.rb', line 6 def response @response end |
#route ⇒ Object
Returns the value of attribute route.
6 7 8 |
# File 'lib/lego/controller/action_context.rb', line 6 def route @route end |
Instance Method Details
#options(key) ⇒ Object
12 13 14 |
# File 'lib/lego/controller/action_context.rb', line 12 def (key) "#{self.class::ApplicationClass.current_config.(key)}" end |
#run(match_data) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/lego/controller/action_context.rb', line 16 def run(match_data) @route, @env, @match_data = match_data setup_instance_vars_from_route evaluate_action [@response[:code], @response[:headers], @response[:body]] end |