Class: CommandTower::Messaging::Rendering::RenderedPushoverPayload
- Inherits:
-
Data
- Object
- Data
- CommandTower::Messaging::Rendering::RenderedPushoverPayload
- Defined in:
- app/services/command_tower/messaging/rendering/rendered_pushover_payload.rb
Overview
Provider-neutral Pushover rendered payload. recipient_address is the opaque endpoint id resolved by RecipientReadiness — never credentials.
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#recipient_address ⇒ Object
readonly
Returns the value of attribute recipient_address.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message
8 9 10 |
# File 'app/services/command_tower/messaging/rendering/rendered_pushover_payload.rb', line 8 def @message end |
#recipient_address ⇒ Object (readonly)
Returns the value of attribute recipient_address
8 9 10 |
# File 'app/services/command_tower/messaging/rendering/rendered_pushover_payload.rb', line 8 def recipient_address @recipient_address end |
#title ⇒ Object (readonly)
Returns the value of attribute title
8 9 10 |
# File 'app/services/command_tower/messaging/rendering/rendered_pushover_payload.rb', line 8 def title @title end |
Class Method Details
.build(recipient_address:, title:, message:) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/services/command_tower/messaging/rendering/rendered_pushover_payload.rb', line 13 def self.build(recipient_address:, title:, message:) values = [recipient_address, title, ] raise ArgumentError, "arbitrary hashes are not accepted" if values.any? { |v| v.is_a?(Hash) } raise ArgumentError, "ActiveRecord objects are not accepted" if values.any? { |v| active_record_like?(v) } raise ArgumentError, "raw exception objects are not accepted" if values.any? { |v| v.is_a?(Exception) } validate_required_string!(recipient_address, "recipient_address") validate_required_string!(title, "title") validate_required_string!(, "message") new( recipient_address:, title:, message:, ).freeze end |