Class: ZohoCrm::Record::DeleteService
- Inherits:
-
BaseService
- Object
- BaseService
- ZohoCrm::Record::DeleteService
- Defined in:
- lib/zoho_crm/record/delete_service.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#module_name ⇒ Object
readonly
Returns the value of attribute module_name.
Instance Method Summary collapse
-
#call ⇒ Object
Delete a record.
-
#initialize(module_name:, id:) ⇒ DeleteService
constructor
A new instance of DeleteService.
Constructor Details
#initialize(module_name:, id:) ⇒ DeleteService
Returns a new instance of DeleteService.
12 13 14 15 |
# File 'lib/zoho_crm/record/delete_service.rb', line 12 def initialize(module_name:, id:) @module_name = module_name @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/zoho_crm/record/delete_service.rb', line 4 def id @id end |
#module_name ⇒ Object (readonly)
Returns the value of attribute module_name.
4 5 6 |
# File 'lib/zoho_crm/record/delete_service.rb', line 4 def module_name @module_name end |
Instance Method Details
#call ⇒ Object
Delete a record.
www.zoho.com/crm/developer/docs/api/v7/delete-records.html
Examples
service = ZohoCrm::Record::DeleteService.call(module_name: 'Contacts', id: '')
service.success? # => true
service.errors # => #<ActiveModel::Errors []>
service.response # => #<Faraday::Response ...>
service.response.status # => 200
service.response.body # => {}
service.facade # => #<ZohoCrm::Record::Facade ...>
service.facade.attributes
service.attributes
DELETE /crm/v7/:module_name/:id
37 38 39 |
# File 'lib/zoho_crm/record/delete_service.rb', line 37 def call connection.delete("#{module_name}/#{id}") end |