Heroku::Nav::Provider

Public Class Methods

fetch() click to toggle source
# File lib/heroku/nav.rb, line 123
def fetch
  super('text/html')
end
html() click to toggle source

for non-rack use

# File lib/heroku/nav.rb, line 132
def html
  @@body ||= fetch
end
resource_url() click to toggle source
# File lib/heroku/nav.rb, line 127
def resource_url
  "#{api_url}/v1/providers/header"
end

Public Instance Methods

can_insert?(env) click to toggle source
# File lib/heroku/nav.rb, line 137
def can_insert?(env)
  super && env['HTTP_COOKIE'] && env['HTTP_COOKIE'].include?('heroku-nav-data')
end
insert!() click to toggle source
# File lib/heroku/nav.rb, line 141
def insert!
  if @nav
    match = @body.match(/(\<body[^\>]*\>)/)
    if match && match.size > 0
      @body.insert(match.end(0), @nav)
      @headers['Content-Length'] = Rack::Utils.bytesize(@body).to_s
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.