class Neo4j::Core::CypherSession::Transactions::HTTP
Public Instance Methods
apply_id_from_url!(url)
click to toggle source
Takes the transaction URL from Neo4j
and parses out the ID
# File lib/neo4j/core/cypher_session/transactions/http.rb 30 def apply_id_from_url!(url) 31 root.instance_variable_set('@id', url.match(%r{/(\d+)/?$})[1].to_i) if url 32 # @id = url.match(%r{/(\d+)/?$})[1].to_i if url 33 end
commit()
click to toggle source
Should perhaps have transaction adaptors only define close
commit/delete are, I think, an implementation detail
# File lib/neo4j/core/cypher_session/transactions/http.rb 11 def commit 12 adaptor.requestor.request(:post, query_path(true)) if started? 13 end
delete()
click to toggle source
# File lib/neo4j/core/cypher_session/transactions/http.rb 15 def delete 16 adaptor.requestor.request(:delete, query_path) if started? 17 end
id()
click to toggle source
# File lib/neo4j/core/cypher_session/transactions/http.rb 39 def id 40 root.instance_variable_get('@id') 41 end
query_path(commit = false)
click to toggle source
# File lib/neo4j/core/cypher_session/transactions/http.rb 19 def query_path(commit = false) 20 if id 21 "/db/data/transaction/#{id}" 22 else 23 '/db/data/transaction' 24 end.tap do |path| 25 path << '/commit' if commit 26 end 27 end
started?()
click to toggle source
# File lib/neo4j/core/cypher_session/transactions/http.rb 35 def started? 36 !!id 37 end
Private Instance Methods
connection()
click to toggle source
# File lib/neo4j/core/cypher_session/transactions/http.rb 45 def connection 46 adaptor.connection 47 end