Class: Rain::RouteEvent

Inherits:
LowEvent
  • Object
show all
Defined in:
lib/router/route_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(route:, action: :render, params: Hash | nil) ⇒ RouteEvent

Returns a new instance of RouteEvent.



9
10
11
12
13
14
# File 'lib/router/route_event.rb', line 9

def initialize(route:, action: :render, params: Hash | nil)
  super(key: route.path, action:)

  @route = route
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



7
8
9
# File 'lib/router/route_event.rb', line 7

def params
  @params
end

#routeObject (readonly)

Returns the value of attribute route.



7
8
9
# File 'lib/router/route_event.rb', line 7

def route
  @route
end