Class: Neo4j::Http::Configuration
- Inherits:
-
Object
- Object
- Neo4j::Http::Configuration
- Defined in:
- lib/neo4j/http/configuration.rb
Instance Attribute Summary collapse
-
#access_mode ⇒ Object
Returns the value of attribute access_mode.
-
#database_name ⇒ Object
Returns the value of attribute database_name.
-
#password ⇒ Object
Returns the value of attribute password.
-
#request_timeout_in_seconds ⇒ Object
Returns the value of attribute request_timeout_in_seconds.
-
#uri ⇒ Object
Returns the value of attribute uri.
-
#user ⇒ Object
Returns the value of attribute user.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
- #auth_token ⇒ Object
-
#initialize(options = ENV) ⇒ Configuration
constructor
A new instance of Configuration.
- #transaction_path ⇒ Object
Constructor Details
#initialize(options = ENV) ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 21 22 |
# File 'lib/neo4j/http/configuration.rb', line 14 def initialize( = ENV) @uri = .fetch("NEO4J_URL", "http://localhost:7474") @user = .fetch("NEO4J_USER", "") @password = .fetch("NEO4J_PASSWORD", "") @database_name = .fetch("NEO4J_DATABASE", nil) @user_agent = .fetch("NEO4J_HTTP_USER_AGENT", "Ruby Neo4j Http Client") @request_timeout_in_seconds = .fetch("NEO4J_REQUEST_TIMEOUT_IN_SECONDS", nil) @access_mode = .fetch("NEO4J_ACCESS_MODE", "WRITE") end |
Instance Attribute Details
#access_mode ⇒ Object
Returns the value of attribute access_mode.
12 13 14 |
# File 'lib/neo4j/http/configuration.rb', line 12 def access_mode @access_mode end |
#database_name ⇒ Object
Returns the value of attribute database_name.
6 7 8 |
# File 'lib/neo4j/http/configuration.rb', line 6 def database_name @database_name end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/neo4j/http/configuration.rb', line 7 def password @password end |
#request_timeout_in_seconds ⇒ Object
Returns the value of attribute request_timeout_in_seconds.
8 9 10 |
# File 'lib/neo4j/http/configuration.rb', line 8 def request_timeout_in_seconds @request_timeout_in_seconds end |
#uri ⇒ Object
Returns the value of attribute uri.
9 10 11 |
# File 'lib/neo4j/http/configuration.rb', line 9 def uri @uri end |
#user ⇒ Object
Returns the value of attribute user.
10 11 12 |
# File 'lib/neo4j/http/configuration.rb', line 10 def user @user end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
11 12 13 |
# File 'lib/neo4j/http/configuration.rb', line 11 def user_agent @user_agent end |
Instance Method Details
#auth_token ⇒ Object
36 37 38 |
# File 'lib/neo4j/http/configuration.rb', line 36 def auth_token Neo4j::Http::AuthToken.token(user, password) end |
#transaction_path ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/neo4j/http/configuration.rb', line 26 def transaction_path # v3.5 - /db/data/transaction/commit # v4.x - /db/#{database_name}/tx/commit if database_name "/db/#{database_name}/tx/commit" else "/db/data/transaction/commit" end end |