module Desk::Authentication

@private

Private Instance Methods

authenticated?() click to toggle source

Check whether user is authenticated

@return [Boolean]

# File lib/desk/authentication.rb, line 51
def authenticated?
  authentication.values.all?
end
authentication() click to toggle source

Authentication hash

@return [Hash]

# File lib/desk/authentication.rb, line 18
def authentication
  if auth_method == Methods::BASIC
    basic_authentication
  else
    oauth_authentication
  end
end
basic_authentication() click to toggle source

Authentication hash for Basic auth connections

@return [Hash]

# File lib/desk/authentication.rb, line 41
def basic_authentication
  {
    :username => basic_auth_username,
    :password => basic_auth_password
  }
end
oauth_authentication() click to toggle source

Authentication hash for OAUTH connections

@return [Hash]

# File lib/desk/authentication.rb, line 29
def oauth_authentication
  {
    :consumer_key => consumer_key,
    :consumer_secret => consumer_secret,
    :token => oauth_token,
    :token_secret => oauth_token_secret
  }
end