Class: Arcp::Job::Event
- Inherits:
-
Data
- Object
- Data
- Arcp::Job::Event
- Defined in:
- lib/arcp/job/event.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body
50 51 52 |
# File 'lib/arcp/job/event.rb', line 50 def body @body end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
50 51 52 |
# File 'lib/arcp/job/event.rb', line 50 def kind @kind end |
Class Method Details
.from_h(h) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/arcp/job/event.rb', line 51 def self.from_h(h) h = h.transform_keys(&:to_s) kind = h.fetch('kind') body_h = h['body'] || {} klass = BODY_CLASSES[kind] body = klass ? klass.from_h(body_h) : Arcp::Envelope.deep_freeze(body_h.dup) new(kind: kind, body: body) end |