class Authograph::Adapters::Rack

Public Class Methods

new(_request) click to toggle source
# File lib/authograph/adapters/rack.rb, line 3
def initialize(_request)
  @request = _request
end

Public Instance Methods

body() click to toggle source
# File lib/authograph/adapters/rack.rb, line 27
def body
  return '' unless @request.body
  data = @request.body.read
  @request.body.rewind
  data
end
content_type() click to toggle source
# File lib/authograph/adapters/rack.rb, line 23
def content_type
  @request.content_type
end
get_header(_header) click to toggle source
# File lib/authograph/adapters/rack.rb, line 7
def get_header(_header)
  @request.env[normalize_header(_header)]
end
method() click to toggle source
# File lib/authograph/adapters/rack.rb, line 15
def method
  @request.request_method.upcase
end
path() click to toggle source
# File lib/authograph/adapters/rack.rb, line 19
def path
  @request.fullpath
end
set_header(_header, _value) click to toggle source
# File lib/authograph/adapters/rack.rb, line 11
def set_header(_header, _value)
  @request.env[normalize_header(_header)] = _value
end

Private Instance Methods

normalize_header(_header) click to toggle source
# File lib/authograph/adapters/rack.rb, line 36
def normalize_header(_header)
  'HTTP_' + _header.underscore.upcase
end