Class: CatchBox::Event
- Inherits:
-
Object
- Object
- CatchBox::Event
- Defined in:
- lib/catch_box/event.rb
Constant Summary collapse
- DELIMITER =
"."
Instance Method Summary collapse
- #call(name) ⇒ Object
-
#initialize ⇒ Event
constructor
A new instance of Event.
- #map(payload) ⇒ Object
Constructor Details
#initialize ⇒ Event
Returns a new instance of Event.
7 8 9 |
# File 'lib/catch_box/event.rb', line 7 def initialize @name = nil end |
Instance Method Details
#call(name) ⇒ Object
11 12 13 |
# File 'lib/catch_box/event.rb', line 11 def call(name) @name = name end |
#map(payload) ⇒ Object
15 16 17 |
# File 'lib/catch_box/event.rb', line 15 def map(payload) payload.dig(*@name.split(DELIMITER)) end |