Sha256: de0ef7e40939331d0ffbf2b7c2806d01dabb119646dbdfc2a61a51442f35a58b

Contents?: true

Size: 730 Bytes

Versions: 6

Compression:

Stored size: 730 Bytes

Contents

module Legion::Extensions::<%= config[:lex].split('_').collect(&:capitalize).join %>
  module Transport
    module Messages
      class <%= config[:name].split('_').collect(&:capitalize).join %> < Legion::Transport::Message
        def initialize(payload, status, options = {})
          @payload = payload
          @options = options
          @status = status
          @routing_key = routing_key
          validate
        end

        def routing_key
          "<%= config[:lex].split('_').collect(&:capitalize).join %>.<%= config[:name].split('_').collect(&:capitalize).join %>"
        end

        def message(payload = @payload, _options = {})
          Legion::JSON.dump(payload)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
legionio-1.2.1 lib/legion/cli/lex/templates/message.erb
legionio-1.2.0 lib/legion/cli/lex/templates/message.erb
legionio-0.4.3 lib/legion/cli/lex/templates/message.erb
legionio-0.4.2 lib/legion/cli/lex/templates/message.erb
legionio-0.4.1 lib/legion/cli/lex/templates/message.erb
legionio-0.4.0 lib/legion/cli/lex/templates/message.erb