Class: Ray::Payloads::Payload
- Inherits:
-
Object
- Object
- Ray::Payloads::Payload
show all
- Defined in:
- lib/ray/payloads/payload.rb
Direct Known Subclasses
BoolPayload, CallerPayload, ColorPayload, CreateLockPayload, CustomPayload, HideAppPayload, HidePayload, IntPayload, JsonStringPayload, LogPayload, NewScreenPayload, NotifyPayload, NullPayload, RemovePayload, ShowAppPayload, SizePayload, StringPayload, TracePayload
Instance Method Summary
collapse
Constructor Details
#initialize(*args) ⇒ Payload
Returns a new instance of Payload.
7
|
# File 'lib/ray/payloads/payload.rb', line 7
def initialize(*args) end
|
Instance Method Details
#content ⇒ Object
13
14
15
|
# File 'lib/ray/payloads/payload.rb', line 13
def content
{}
end
|
#to_hash ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/ray/payloads/payload.rb', line 17
def to_hash
{
type: self.type,
content: self.content,
origin: self.get_origin.to_hash
}
end
|
#type ⇒ Object
9
10
11
|
# File 'lib/ray/payloads/payload.rb', line 9
def type
raise NotImplementedError, 'You must define the `type` method in your Payload'
end
|