Class: AuthKeyCookie

Inherits:
Object
  • Object
show all
Includes:
AuthProvider
Defined in:
lib/one_doc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cookie_name: nil, val: nil) ⇒ AuthKeyCookie

Returns a new instance of AuthKeyCookie.



116
117
118
119
# File 'lib/one_doc.rb', line 116

def initialize(cookie_name: nil, val: nil)
  @cookie_name = cookie_name
  @val = val
end

Instance Attribute Details

Returns the value of attribute cookie_name.



114
115
116
# File 'lib/one_doc.rb', line 114

def cookie_name
  @cookie_name
end

#valObject

Returns the value of attribute val.



114
115
116
# File 'lib/one_doc.rb', line 114

def val
  @val
end

Instance Method Details

#add_auth(http_client, req_kwargs) ⇒ Object



121
122
123
124
125
126
127
# File 'lib/one_doc.rb', line 121

def add_auth(http_client, req_kwargs)
  if !@val.nil?
    http_client = http_client.cookies(@cookie_name => @val)
  end

  return http_client, req_kwargs
end