Module: FreshdeskAPI::Destroy
- Included in:
- Resource
- Defined in:
- lib/freshdesk_api/actions.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#destroy ⇒ Object
instance method.
-
#destroy! ⇒ Boolean
If this resource hasn’t already been deleted, then do so.
-
#destroyed? ⇒ Boolean
Has this object been deleted?.
Class Method Details
.included(klass) ⇒ Object
149 150 151 |
# File 'lib/freshdesk_api/actions.rb', line 149 def self.included(klass) klass.extend(ClassMethods) end |
Instance Method Details
#destroy ⇒ Object
instance method
171 172 173 174 175 |
# File 'lib/freshdesk_api/actions.rb', line 171 def destroy destroy! rescue FreshdeskAPI::Error::ClientError false end |
#destroy! ⇒ Boolean
If this resource hasn’t already been deleted, then do so. instance method
161 162 163 164 165 166 167 168 |
# File 'lib/freshdesk_api/actions.rb', line 161 def destroy! return false if destroyed? || new_record? path = api_url + "/#{id}" @client.make_request!(path, :delete) @destroyed = true end |
#destroyed? ⇒ Boolean
Has this object been deleted?
154 155 156 |
# File 'lib/freshdesk_api/actions.rb', line 154 def destroyed? @destroyed ||= false end |