Class: Postal::SendResult
- Inherits:
-
Object
- Object
- Postal::SendResult
- Defined in:
- lib/postal/send_result.rb
Instance Method Summary collapse
- #[](recipient) ⇒ Object
-
#initialize(client, result) ⇒ SendResult
constructor
A new instance of SendResult.
- #message_id ⇒ Object
- #recipients ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(client, result) ⇒ SendResult
Returns a new instance of SendResult.
4 5 6 7 |
# File 'lib/postal/send_result.rb', line 4 def initialize(client, result) @client = client @result = result end |
Instance Method Details
#[](recipient) ⇒ Object
21 22 23 |
# File 'lib/postal/send_result.rb', line 21 def [](recipient) recipients[recipient.to_s.downcase] end |
#message_id ⇒ Object
9 10 11 |
# File 'lib/postal/send_result.rb', line 9 def @result['message_id'] end |
#recipients ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/postal/send_result.rb', line 13 def recipients @recipients ||= begin @result['messages'].each_with_object({}) do |(recipient, ), hash| hash[recipient.to_s.downcase] = Message.new(@client, ) end end end |
#size ⇒ Object
25 26 27 |
# File 'lib/postal/send_result.rb', line 25 def size recipients.size end |