class PostBin::Post

Represents header/body information of a HTTP POST request.

Attributes

body[R]
headers[R]
received_at[R]

Public Class Methods

new(headers, body, received_at = nil) click to toggle source
# File lib/postbin/post.rb, line 7
def initialize(headers, body, received_at = nil)
  @received_at = received_at || Time.now
  @headers = headers
  @body = body
end

Public Instance Methods

==(other) click to toggle source

Returns true only if the two posts contain equal data.

# File lib/postbin/post.rb, line 14
def ==(other)
  return false unless Post === other
  return false unless received_at == other.received_at
  return false unless headers == other.headers
  body == other.body
end
to_json(*options) click to toggle source
# File lib/postbin/post.rb, line 21
def to_json(*options)
  MultiJson.encode({ :received_at => received_at, :headers => headers, :body => body })
end