Class: Zm::Client::Message::Recipients

Inherits:
Object
  • Object
show all
Defined in:
lib/zm/client/message/message_recipients.rb

Overview

Collection recipients

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRecipients

Returns a new instance of Recipients.



10
11
12
# File 'lib/zm/client/message/message_recipients.rb', line 10

def initialize
  @all = []
end

Instance Attribute Details

#allObject (readonly)

Returns the value of attribute all.



8
9
10
# File 'lib/zm/client/message/message_recipients.rb', line 8

def all
  @all
end

Instance Method Details

#add(recipient) ⇒ Object



14
15
16
17
18
# File 'lib/zm/client/message/message_recipients.rb', line 14

def add(recipient)
  return unless recipient.is_a?(Zm::Client::Recipient)

  @all.push(recipient)
end

#bccObject



28
29
30
# File 'lib/zm/client/message/message_recipients.rb', line 28

def bcc
  @all.select { |r| r.field == Zm::Client::Recipient::BCC }
end

#ccObject



24
25
26
# File 'lib/zm/client/message/message_recipients.rb', line 24

def cc
  @all.select { |r| r.field == Zm::Client::Recipient::CC }
end

#fromObject



32
33
34
# File 'lib/zm/client/message/message_recipients.rb', line 32

def from
  @all.select { |r| r.field == Zm::Client::Recipient::FROM }
end

#toObject



20
21
22
# File 'lib/zm/client/message/message_recipients.rb', line 20

def to
  @all.select { |r| r.field == Zm::Client::Recipient::TO }
end