Sha256: bb3cda54477ccaf092b036ed224061428ba203fdd9017fb6cb875e7922a1531b

Contents?: true

Size: 356 Bytes

Versions: 23

Compression:

Stored size: 356 Bytes

Contents

module Euston
  class Event
    def initialize data = {}
      if (data.keys & ['body', 'headers']).size == 2
        @body, @headers = data.values_at 'body', 'headers'
      else
        @headers = {}
        @body = data
      end
    end

    attr_reader :headers, :body

    def to_hash
      { :headers => @headers, :body => @body }
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
euston-1.2.10 lib/euston/event.rb
euston-1.2.10-java lib/euston/event.rb
euston-1.2.9-java lib/euston/event.rb
euston-1.2.9 lib/euston/event.rb
euston-1.2.8 lib/euston/event.rb
euston-1.2.8-java lib/euston/event.rb
euston-1.2.7-java lib/euston/event.rb
euston-1.2.7 lib/euston/event.rb
euston-1.2.6 lib/euston/event.rb
euston-1.2.5-java lib/euston/event.rb
euston-1.2.5 lib/euston/event.rb
euston-1.2.4-java lib/euston/event.rb
euston-1.2.4 lib/euston/event.rb
euston-1.2.3 lib/euston/event.rb
euston-1.2.3-java lib/euston/event.rb
euston-1.2.2 lib/euston/event.rb
euston-1.2.2-java lib/euston/event.rb
euston-1.2.1 lib/euston/event.rb
euston-1.2.1-java lib/euston/event.rb
euston-1.2.0 lib/euston/event.rb