Class: BetterAuth::Context::DirectAPIRequest
- Inherits:
-
Object
- Object
- BetterAuth::Context::DirectAPIRequest
- Defined in:
- lib/better_auth/context.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #get_header(key) ⇒ Object
-
#initialize(headers, url) ⇒ DirectAPIRequest
constructor
A new instance of DirectAPIRequest.
Constructor Details
#initialize(headers, url) ⇒ DirectAPIRequest
Returns a new instance of DirectAPIRequest.
326 327 328 329 |
# File 'lib/better_auth/context.rb', line 326 def initialize(headers, url) @headers = headers.transform_keys { |key| key.to_s.downcase } @url = url end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
324 325 326 |
# File 'lib/better_auth/context.rb', line 324 def headers @headers end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
324 325 326 |
# File 'lib/better_auth/context.rb', line 324 def url @url end |
Instance Method Details
#get_header(key) ⇒ Object
331 332 333 334 335 336 337 |
# File 'lib/better_auth/context.rb', line 331 def get_header(key) normalized = key.to_s .sub(/\AHTTP_/, "") .downcase .tr("_", "-") headers[normalized] || headers[key.to_s] || headers[key.to_s.downcase] end |