Class: BirdGrinder::Tweeter::BasicAuthorization

Inherits:
AbstractAuthorization show all
Defined in:
lib/bird_grinder/tweeter/basic_authorization.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractAuthorization

#add_header_to

Constructor Details

#initializeBasicAuthorization

Returns a new instance of BasicAuthorization.



5
6
7
# File 'lib/bird_grinder/tweeter/basic_authorization.rb', line 5

def initialize
  @basic_auth_credentials = [BirdGrinder::Settings.username, BirdGrinder::Settings.password]
end

Instance Attribute Details

#basic_auth_credentialsObject (readonly)

Returns the value of attribute basic_auth_credentials.



9
10
11
# File 'lib/bird_grinder/tweeter/basic_authorization.rb', line 9

def basic_auth_credentials
  @basic_auth_credentials
end

Instance Method Details

#header_for(http) ⇒ Object

Authenticats a given request using Basic authorization.



12
13
14
# File 'lib/bird_grinder/tweeter/basic_authorization.rb', line 12

def header_for(http)
  @basic_auth_credentials
end