Class: Moonrope::BeforeAction

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller) ⇒ BeforeAction

Initilize a new BeforeAction

Parameters:



18
19
20
21
# File 'lib/moonrope/before_action.rb', line 18

def initialize(controller)
  @controller = controller
  @actions = []
end

Instance Attribute Details

#actionsArray

Returns the names of actions to execute this request on.

Returns:

  • (Array)

    the names of actions to execute this request on



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

def actions
  @actions
end

#blockProc

Returns the block to execute in this action.

Returns:

  • (Proc)

    the block to execute in this action



8
9
10
# File 'lib/moonrope/before_action.rb', line 8

def block
  @block
end

#controllerMoonrope::Controller (readonly)

Returns the associated controller.

Returns:



11
12
13
# File 'lib/moonrope/before_action.rb', line 11

def controller
  @controller
end