Class: AuthKeyQuery

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of AuthKeyQuery.



73
74
75
76
# File 'lib/sideko_hacker_news.rb', line 73

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.



71
72
73
# File 'lib/sideko_hacker_news.rb', line 71

def query_name
  @query_name
end

#valObject

Returns the value of attribute val.



71
72
73
# File 'lib/sideko_hacker_news.rb', line 71

def val
  @val
end

Instance Method Details

#add_auth(http_client, req_kwargs) ⇒ Object



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

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