Class: Low::Events::StatusEvent

Inherits:
Low::Event show all
Defined in:
lib/events/status_event.rb

Instance Attribute Summary collapse

Attributes inherited from Low::Event

#action, #children, #created_at, #key

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Low::Event

add_event, count, events, increase_count, inherited, #take, take, #trigger

Methods included from Support::ValueObject

#==, #eql?, #hash

Methods included from Definable

#define, included

Constructor Details

#initialize(status:, request:, key: nil, action: :render) ⇒ StatusEvent

Returns a new instance of StatusEvent.



10
11
12
13
14
15
# File 'lib/events/status_event.rb', line 10

def initialize(status:, request:, key: nil, action: :render)
  super(key: key || status, action:)

  @status = status
  @request = request
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



8
9
10
# File 'lib/events/status_event.rb', line 8

def request
  @request
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/events/status_event.rb', line 8

def status
  @status
end

Class Method Details

.trigger(status:, **kwargs) ⇒ Object



19
20
21
# File 'lib/events/status_event.rb', line 19

def trigger(status:, **kwargs)
  new(status:, **kwargs).trigger || new(status:, key: Status, **kwargs).trigger
end