Class: Keymaker::DeleteRelationshipRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/keymaker/requests/delete_relationship_request.rb

Overview

DELETE localhost:7474/db/data/relationship/85 Accept: application/json Content-Type: application/json

Instance Attribute Summary

Attributes inherited from Request

#config, #opts, #service

Instance Method Summary collapse

Methods inherited from Request

#initialize

Constructor Details

This class inherits a constructor from Keymaker::Request

Instance Method Details

#submitObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/keymaker/requests/delete_relationship_request.rb', line 11

def submit
  service.delete(relationship_path(opts[:relationship_id])).on_error do |response|
    case response.status
    when 404
      raise ResourceNotFound.new(response, response.body)
    when (400..499)
      raise ClientError.new(response, response.body)
    when (500..599)
      raise ServerError.new(response, response.body)
    end
  end
end