Class: RSMP::Delivery
- Inherits:
-
Data
- Object
- Data
- RSMP::Delivery
- Defined in:
- lib/rsmp/delivery.rb
Overview
The disposition of a successfully submitted outbound message.
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #buffered? ⇒ Boolean
-
#initialize(message:, state:) ⇒ Delivery
constructor
A new instance of Delivery.
- #sent? ⇒ Boolean
Constructor Details
#initialize(message:, state:) ⇒ Delivery
Returns a new instance of Delivery.
4 5 6 7 8 |
# File 'lib/rsmp/delivery.rb', line 4 def initialize(message:, state:) raise ArgumentError, 'delivery state must be :sent or :buffered' unless i[sent buffered].include?(state) super end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message
3 4 5 |
# File 'lib/rsmp/delivery.rb', line 3 def end |
#state ⇒ Object (readonly)
Returns the value of attribute state
3 4 5 |
# File 'lib/rsmp/delivery.rb', line 3 def state @state end |
Instance Method Details
#buffered? ⇒ Boolean
14 15 16 |
# File 'lib/rsmp/delivery.rb', line 14 def buffered? state == :buffered end |
#sent? ⇒ Boolean
10 11 12 |
# File 'lib/rsmp/delivery.rb', line 10 def sent? state == :sent end |