Module: Neography::Rest::Helpers

Instance Method Summary collapse

Instance Method Details

#get_id(id) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/neography/rest/helpers.rb', line 5

def get_id(id)
  case id
  when Array
    get_id(id.first)
  when Hash
    id["self"].split('/').last
  when String
    id.split('/').last
  when Neography::Node, Neography::Relationship
    id.neo_id
  else
    id
  end
end

#json_content_typeObject



20
21
22
# File 'lib/neography/rest/helpers.rb', line 20

def json_content_type
  {'Content-Type' => 'application/json'}
end