Class: Moonrope::BeforeAction
- Inherits:
-
Object
- Object
- Moonrope::BeforeAction
- Defined in:
- lib/moonrope/before_action.rb
Instance Attribute Summary collapse
-
#actions ⇒ Array
The names of actions to execute this request on.
-
#block ⇒ Proc
The block to execute in this action.
-
#controller ⇒ Moonrope::Controller
readonly
The associated controller.
Instance Method Summary collapse
-
#initialize(controller) ⇒ BeforeAction
constructor
Initilize a new BeforeAction.
Constructor Details
#initialize(controller) ⇒ BeforeAction
Initilize a new BeforeAction
18 19 20 21 |
# File 'lib/moonrope/before_action.rb', line 18 def initialize(controller) @controller = controller @actions = [] end |
Instance Attribute Details
#actions ⇒ Array
Returns the names of actions to execute this request on.
5 6 7 |
# File 'lib/moonrope/before_action.rb', line 5 def actions @actions end |
#block ⇒ Proc
Returns the block to execute in this action.
8 9 10 |
# File 'lib/moonrope/before_action.rb', line 8 def block @block end |
#controller ⇒ Moonrope::Controller (readonly)
Returns the associated controller.
11 12 13 |
# File 'lib/moonrope/before_action.rb', line 11 def controller @controller end |