Class: Hanami::Lambda::Event Private
- Inherits:
-
Object
- Object
- Hanami::Lambda::Event
- Defined in:
- lib/hanami/lambda/event.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Base event class
Instance Attribute Summary collapse
- #raw ⇒ Object readonly private
Instance Method Summary collapse
-
#[](key) ⇒ Object, NilClass
private
Return the value of the given key.
-
#get(*keys) ⇒ Object, NilClass
(also: #dig)
private
Return an value associated with the given event key.
- #initialize(event) ⇒ Hanami::Lambda::Event constructor private
-
#to_h ⇒ Hash
private
Return the hash of the event.
Constructor Details
#initialize(event) ⇒ Hanami::Lambda::Event
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 20 21 |
# File 'lib/hanami/lambda/event.rb', line 17 def initialize(event) @raw = event @event = Hanami::Utils::Hash.deep_symbolize(@raw) freeze end |
Instance Attribute Details
#raw ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/hanami/lambda/event.rb', line 11 def raw @raw end |
Instance Method Details
#[](key) ⇒ Object, NilClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return the value of the given key
30 31 32 |
# File 'lib/hanami/lambda/event.rb', line 30 def [](key) @event[key] end |
#get(*keys) ⇒ Object, NilClass Also known as: dig
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return an value associated with the given event key
41 42 43 |
# File 'lib/hanami/lambda/event.rb', line 41 def get(*keys) @event.dig(*keys) end |
#to_h ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return the hash of the event
51 52 53 |
# File 'lib/hanami/lambda/event.rb', line 51 def to_h @event end |