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.
350 351 352 353 |
# File 'lib/better_auth/context.rb', line 350 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.
348 349 350 |
# File 'lib/better_auth/context.rb', line 348 def headers @headers end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
348 349 350 |
# File 'lib/better_auth/context.rb', line 348 def url @url end |
Instance Method Details
#get_header(key) ⇒ Object
355 356 357 358 359 360 361 |
# File 'lib/better_auth/context.rb', line 355 def get_header(key) normalized = key.to_s .sub(/\AHTTP_/, "") .downcase .tr("_", "-") headers[normalized] || headers[key.to_s] || headers[key.to_s.downcase] end |