Sha256: 178e5b611a42fc72bbfc2d52565c1a5ea1ce65723030c6967798511ce391c04b

Contents?: true

Size: 519 Bytes

Versions: 8

Compression:

Stored size: 519 Bytes

Contents

module Qs

  class Message

    attr_reader :payload_type, :params

    def initialize(payload_type, options = nil)
      options ||= {}
      @payload_type = payload_type.to_s
      @params       = options[:params] || {}
    end

    def route_id
      @route_id ||= RouteId.new(self.payload_type, self.route_name)
    end

    def route_name
      raise NotImplementedError
    end

    module RouteId
      def self.new(payload_type, route_name)
        "#{payload_type}|#{route_name}"
      end
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
qs-0.8.1 lib/qs/message.rb
qs-0.8.0 lib/qs/message.rb
qs-0.7.1 lib/qs/message.rb
qs-0.7.0 lib/qs/message.rb
qs-0.6.1 lib/qs/message.rb
qs-0.6.0 lib/qs/message.rb
qs-0.5.0 lib/qs/message.rb
qs-0.4.0 lib/qs/message.rb