Class: Mailflow::SendResult

Inherits:
Object
  • Object
show all
Defined in:
lib/mailflow/send_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, result) ⇒ SendResult

Returns a new instance of SendResult.



5
6
7
8
9
# File 'lib/mailflow/send_result.rb', line 5

def initialize(client, result)
  @client = client
  @message_id = result['message_id']
  @recipients = build_recipients(result['messages'])
end

Instance Attribute Details

#message_idObject (readonly)

Returns the value of attribute message_id.



3
4
5
# File 'lib/mailflow/send_result.rb', line 3

def message_id
  @message_id
end

#recipientsObject (readonly)

Returns the value of attribute recipients.



3
4
5
# File 'lib/mailflow/send_result.rb', line 3

def recipients
  @recipients
end

Instance Method Details

#[](recipient) ⇒ Object



11
12
13
# File 'lib/mailflow/send_result.rb', line 11

def [](recipient)
  recipients[recipient.to_s.downcase]
end

#sizeObject



15
16
17
# File 'lib/mailflow/send_result.rb', line 15

def size
  recipients.size
end