Class: Booth::Adminland::Onboardings::Destroy
- Inherits:
-
Object
- Object
- Booth::Adminland::Onboardings::Destroy
- Includes:
- Logging, MethodObject
- Defined in:
- lib/booth/adminland/onboardings/destroy.rb
Instance Method Summary collapse
Methods included from MethodObject
Instance Method Details
#call ⇒ Object
10 11 12 13 14 |
# File 'lib/booth/adminland/onboardings/destroy.rb', line 10 def call do_verify_id .on_success { do_find_record } .on_success { do_destroy_record } end |
#do_destroy_record ⇒ Object
30 31 32 33 34 |
# File 'lib/booth/adminland/onboardings/destroy.rb', line 30 def do_destroy_record return Tron.success(:onboarding_deleted, id: record.id, credential_id:) if record.destroy Tron.failure :could_not_delete_onboarding, id: record.id, credential_id: end |
#do_find_record ⇒ Object
23 24 25 26 27 28 |
# File 'lib/booth/adminland/onboardings/destroy.rb', line 23 def do_find_record return Tron.success :record_found if record debug { "Could not find Onboarding with ID #{id.inspect}" } Tron.failure :onboarding_not_found, id: nil, credential_id: nil end |
#do_verify_id ⇒ Object
16 17 18 19 20 21 |
# File 'lib/booth/adminland/onboardings/destroy.rb', line 16 def do_verify_id return Tron.success :valid_id_syntax if id debug { "Invalid Onboarding ID #{raw_id.inspect}" } Tron.failure :invalid_id_syntax, id:, credential_id: nil end |