Class: CycloneLariat::Messages::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/cyclone_lariat/messages/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_message:) ⇒ Builder

Returns a new instance of Builder.



14
15
16
17
18
# File 'lib/cyclone_lariat/messages/builder.rb', line 14

def initialize(raw_message:)
  @raw_message = raw_message
  @kind = kind
  @raw_message[:type] = message_type
end

Instance Attribute Details

#raw_messageObject (readonly)

Returns the value of attribute raw_message.



12
13
14
# File 'lib/cyclone_lariat/messages/builder.rb', line 12

def raw_message
  @raw_message
end

Instance Method Details

#callObject



20
21
22
23
24
25
26
# File 'lib/cyclone_lariat/messages/builder.rb', line 20

def call
  case @kind
  when 'event' then event_builder
  when 'command' then command_builder
  else Messages::Common.wrap(message_without_kind)
  end
end