Sha256: b8d58252d1c3390466f1059ab9d6564b459d4ebdf69a3bb0b48858d6ad7da74f

Contents?: true

Size: 313 Bytes

Versions: 15

Compression:

Stored size: 313 Bytes

Contents

module Spontaneous
  module Rack
    class SSE
      attr_reader :event, :data

      def initialize(params)
        @event = params[:event]
        @data  = params[:data]
      end

      def to_sse
        lines = ["event: #{event}", "data: #{data}", "\n"]
        lines.join("\n")
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.beta9 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.beta8 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.beta7 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.beta6 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.beta5 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.beta4 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.beta3 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.beta2 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.beta1 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.alpha7 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.alpha6 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.alpha5 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.alpha4 lib/spontaneous/rack/sse.rb
spontaneous-0.2.0.alpha3 lib/spontaneous/rack/sse.rb