Class: SurveyMonkey::Recipients
- Inherits:
-
Object
- Object
- SurveyMonkey::Recipients
- Includes:
- Enumerable
- Defined in:
- lib/survey_monkey/recipients.rb
Instance Method Summary collapse
- #<<(recipient) ⇒ Object
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(*recipients) ⇒ Recipients
constructor
A new instance of Recipients.
- #to_hash ⇒ Object
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
23 24 25 |
# File 'lib/survey_monkey/recipients.rb', line 23 def empty? count == 0 end |
#to_hash ⇒ Object
19 20 21 |
# File 'lib/survey_monkey/recipients.rb', line 19 def to_hash map { |e| e.to_hash } end |