Class: CommandTower::Messaging::Pushover::Result
- Inherits:
-
Struct
- Object
- Struct
- CommandTower::Messaging::Pushover::Result
- Defined in:
- app/services/command_tower/messaging/pushover/result.rb
Overview
Provider-call result. Never includes secrets or raw provider payloads.
Instance Attribute Summary collapse
-
#error_code ⇒ Object
Returns the value of attribute error_code.
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#provider_request_id ⇒ Object
Returns the value of attribute provider_request_id.
-
#success? ⇒ Object
Returns the value of attribute success?.
Class Method Summary collapse
- .failure(error_code:, error_message:, provider_request_id: nil) ⇒ Object
- .ok(provider_request_id: nil) ⇒ Object
Instance Attribute Details
#error_code ⇒ Object
Returns the value of attribute error_code
7 8 9 |
# File 'app/services/command_tower/messaging/pushover/result.rb', line 7 def error_code @error_code end |
#error_message ⇒ Object
Returns the value of attribute error_message
7 8 9 |
# File 'app/services/command_tower/messaging/pushover/result.rb', line 7 def @error_message end |
#provider_request_id ⇒ Object
Returns the value of attribute provider_request_id
7 8 9 |
# File 'app/services/command_tower/messaging/pushover/result.rb', line 7 def provider_request_id @provider_request_id end |
#success? ⇒ Object
Returns the value of attribute success?
7 8 9 |
# File 'app/services/command_tower/messaging/pushover/result.rb', line 7
def success?
@success?
end
|
Class Method Details
.failure(error_code:, error_message:, provider_request_id: nil) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'app/services/command_tower/messaging/pushover/result.rb', line 23 def self.failure(error_code:, error_message:, provider_request_id: nil) new( success?: false, error_code: error_code.to_sym, error_message: .to_s, provider_request_id: provider_request_id&.to_s.presence, ) end |
.ok(provider_request_id: nil) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/services/command_tower/messaging/pushover/result.rb', line 14 def self.ok(provider_request_id: nil) new( success?: true, error_code: nil, error_message: nil, provider_request_id: provider_request_id&.to_s.presence, ) end |