Class: Hover::Client::BasicAuth

Inherits:
HTTP
  • Object
show all
Defined in:
lib/hover/client/basic_auth.rb

Instance Attribute Summary collapse

Attributes inherited from HTTP

#prefix, #site

Instance Method Summary collapse

Methods inherited from HTTP

#delete, #get, #get_redirect_location, #make_form_request, #make_request, #make_uri, #parse_response, #patch, #post, #put, #raise_errors, #raise_errors_for_cloudfront_response

Constructor Details

#initialize(username, password) ⇒ BasicAuth

Returns a new instance of BasicAuth.



8
9
10
11
# File 'lib/hover/client/basic_auth.rb', line 8

def initialize(username, password)
  self.username = username
  self.password = password
end

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



6
7
8
# File 'lib/hover/client/basic_auth.rb', line 6

def password
  @password
end

#usernameObject

Returns the value of attribute username.



6
7
8
# File 'lib/hover/client/basic_auth.rb', line 6

def username
  @username
end

Instance Method Details

#authenticate(request) ⇒ Object



13
14
15
# File 'lib/hover/client/basic_auth.rb', line 13

def authenticate(request)
  request.basic_auth(username, password)
end