class Atompub::Auth::Basic

Atompub::Auth::Basic

Usage:

auth = Atompub::Auth::Basic.new :username => username, :password => password
client = Atompub::Client.new :auth => auth

Public Class Methods

new(params) click to toggle source

initializer

Set two parameters as hash

  • username

  • password

Usage:

auth = Atompub::Auth::Basic.new :username => name, :password => pass
# File lib/atomutil.rb, line 1727
def initialize(params)
  @username, @password = params[:username], params[:password]
end

Public Instance Methods

authorize(req) click to toggle source

Add credential info to Net::HTTP::Request object

Usage:

req = Net::HTTP::Get.new uri.request_uri
auth.authorize(req)
# File lib/atomutil.rb, line 1737
def authorize(req)
  req.basic_auth @username, @password
end