Class: Ray::Payloads::CustomPayload

Inherits:
Payload
  • Object
show all
Defined in:
lib/ray/payloads/custom_payload.rb

Instance Method Summary collapse

Methods inherited from Payload

#get_origin, #to_hash

Constructor Details

#initialize(content, label = '') ⇒ CustomPayload

Returns a new instance of CustomPayload.



5
6
7
8
# File 'lib/ray/payloads/custom_payload.rb', line 5

def initialize(content, label = '')
  @content = content
  @label = label
end

Instance Method Details

#contentObject



14
15
16
17
18
19
# File 'lib/ray/payloads/custom_payload.rb', line 14

def content
  {
    content: @content,
    label: @label
  }
end

#typeObject



10
11
12
# File 'lib/ray/payloads/custom_payload.rb', line 10

def type
  'custom'
end