Class: Neo4j::Http::AuthToken
- Inherits:
-
Object
- Object
- Neo4j::Http::AuthToken
- Defined in:
- lib/neo4j/http/auth_token.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(username, password) ⇒ AuthToken
constructor
A new instance of AuthToken.
- #token ⇒ Object
Constructor Details
#initialize(username, password) ⇒ AuthToken
Returns a new instance of AuthToken.
10 11 12 13 |
# File 'lib/neo4j/http/auth_token.rb', line 10 def initialize(username, password) @username = username @password = password end |
Class Method Details
.token(username, password) ⇒ Object
6 7 8 |
# File 'lib/neo4j/http/auth_token.rb', line 6 def self.token(username, password) new(username, password).token end |
Instance Method Details
#token ⇒ Object
16 17 18 19 20 |
# File 'lib/neo4j/http/auth_token.rb', line 16 def token return "" if @username.blank? || @password.blank? Base64.encode64("#{@username}:#{@password}") end |