class RailsRiemannMiddleware::Headers

Attributes

custom_headers[R]
env[R]

Public Class Methods

new(env, custom_headers=[]) click to toggle source
# File lib/rails_riemann_middleware/headers.rb, line 7
def initialize(env, custom_headers=[])
  @env = env
  @custom_headers = custom_headers
end

Public Instance Methods

keys() click to toggle source
# File lib/rails_riemann_middleware/headers.rb, line 12
def keys
  %w{REQUEST_METHOD REQUEST_URI PATH_INFO HTTP_X_REAL_IP HTTP_USER_AGENT HTTP_REFERER} + custom_headers
end
to_a() click to toggle source
# File lib/rails_riemann_middleware/headers.rb, line 16
def to_a
  keys.map { |h| " #{h.downcase}: #{env.fetch(h, "N/A")}" }
end
to_s() click to toggle source
# File lib/rails_riemann_middleware/headers.rb, line 20
def to_s
  to_a.join("\n")
end