Module: Neo4j::Core::CypherSession::Adaptors::HasUri::ClassMethods

Defined in:
lib/neo4j/core/cypher_session/adaptors/has_uri.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#default_uriObject (readonly)

Returns the value of attribute default_uri.



12
13
14
# File 'lib/neo4j/core/cypher_session/adaptors/has_uri.rb', line 12

def default_uri
  @default_uri
end

Instance Method Details

#default_url(default_url) ⇒ Object



14
15
16
# File 'lib/neo4j/core/cypher_session/adaptors/has_uri.rb', line 14

def default_url(default_url)
  @default_uri = uri_from_url!(default_url)
end

#uri_from_url!(url) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/neo4j/core/cypher_session/adaptors/has_uri.rb', line 22

def uri_from_url!(url)
  validate_url!(url)

  @uri = url.nil? ? @default_uri : URI(url)

  fail ArgumentError, "Invalid URL: #{url.inspect}" if uri_valid?(@uri)

  @uri
end

#validate_uri(&block) ⇒ Object



18
19
20
# File 'lib/neo4j/core/cypher_session/adaptors/has_uri.rb', line 18

def validate_uri(&block)
  @uri_validator = block
end