Class: SurveyMonkey::Recipients

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/survey_monkey/recipients.rb

Instance Method Summary collapse

Constructor Details

#initialize(*recipients) ⇒ Recipients

Returns a new instance of Recipients.



5
6
7
# File 'lib/survey_monkey/recipients.rb', line 5

def initialize(*recipients)
  @recipients = ( recipients || Array.new )
end

Instance Method Details

#<<(recipient) ⇒ Object



15
16
17
# File 'lib/survey_monkey/recipients.rb', line 15

def <<(recipient)
  @recipients << recipient
end

#each(&block) ⇒ Object



9
10
11
12
13
# File 'lib/survey_monkey/recipients.rb', line 9

def each(&block)
  @recipients.each do |recipient|
    block.call(recipient)
  end
end

#empty?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/survey_monkey/recipients.rb', line 23

def empty?
  count == 0
end

#to_hashObject



19
20
21
# File 'lib/survey_monkey/recipients.rb', line 19

def to_hash
  map { |e| e.to_hash }
end