Sha256: ca2d691b2ed705c063da3e78de54d3730591cd1d22d281156e2de0f0975051b3

Contents?: true

Size: 544 Bytes

Versions: 3

Compression:

Stored size: 544 Bytes

Contents

module Aggro
  module Message
    # Public: Start saga message.
    class StartSaga < Struct.new(:sender, :id, :details)
      TYPE_CODE = '13'.freeze

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

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

      def args
        details[:args]
      end

      def name
        details[:name]
      end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aggro-0.0.4 lib/aggro/message/start_saga.rb
aggro-0.0.3 lib/aggro/message/start_saga.rb
aggro-0.0.2 lib/aggro/message/start_saga.rb