Class: AuthKeyQuery

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query_name: nil, val: nil) ⇒ AuthKeyQuery

Returns a new instance of AuthKeyQuery.



74
75
76
77
# File 'lib/one_doc.rb', line 74

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

Instance Attribute Details

#query_nameObject

Returns the value of attribute query_name.



72
73
74
# File 'lib/one_doc.rb', line 72

def query_name
  @query_name
end

#valObject

Returns the value of attribute val.



72
73
74
# File 'lib/one_doc.rb', line 72

def val
  @val
end

Instance Method Details

#add_auth(http_client, req_kwargs) ⇒ Object



79
80
81
82
83
84
85
86
87
# File 'lib/one_doc.rb', line 79

def add_auth(http_client, req_kwargs)
  if !val.nil?
    params = req_kwargs.fetch(:params, {})
    params[query_name] = val
    req_kwargs[:params] = params
  end

  return http_client, req_kwargs
end