Class: Aggro::Message::StartSaga

Inherits:
Struct
  • Object
show all
Defined in:
lib/aggro/message/start_saga.rb

Overview

Public: Start saga message.

Constant Summary collapse

TYPE_CODE =
'13'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#detailsObject

Returns the value of attribute details

Returns:

  • (Object)

    the current value of details



4
5
6
# File 'lib/aggro/message/start_saga.rb', line 4

def details
  @details
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



4
5
6
# File 'lib/aggro/message/start_saga.rb', line 4

def id
  @id
end

#senderObject

Returns the value of attribute sender

Returns:

  • (Object)

    the current value of sender



4
5
6
# File 'lib/aggro/message/start_saga.rb', line 4

def sender
  @sender
end

Class Method Details

.parse(string) ⇒ Object



7
8
9
# File 'lib/aggro/message/start_saga.rb', line 7

def self.parse(string)
  new string[2..37], string[38..73], parse_details(string[74..-1])
end

.parse_details(details) ⇒ Object



11
12
13
# File 'lib/aggro/message/start_saga.rb', line 11

def self.parse_details(details)
  Marshal.load details
end

Instance Method Details

#argsObject



15
16
17
# File 'lib/aggro/message/start_saga.rb', line 15

def args
  details[:args]
end

#nameObject



19
20
21
# File 'lib/aggro/message/start_saga.rb', line 19

def name
  details[:name]
end

#to_sObject



23
24
25
# File 'lib/aggro/message/start_saga.rb', line 23

def to_s
  "#{TYPE_CODE}#{sender}#{id}#{Marshal.dump details}"
end