Class: SurveyMonkey::Recipient
- Inherits:
-
Object
- Object
- SurveyMonkey::Recipient
- Defined in:
- lib/survey_monkey/recipient.rb
Instance Attribute Summary collapse
-
#custom_id ⇒ Object
Returns the value of attribute custom_id.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Recipient
constructor
A new instance of Recipient.
- #to_hash ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Recipient
Returns a new instance of Recipient.
5 6 7 8 9 10 11 |
# File 'lib/survey_monkey/recipient.rb', line 5 def initialize( = {}) @email = [:email] @first_name = [:first_name] @last_name = [:last_name] @custom_id = [:custom_id] raise "Email Required for Recipient" if email.nil? end |
Instance Attribute Details
#custom_id ⇒ Object
Returns the value of attribute custom_id.
3 4 5 |
# File 'lib/survey_monkey/recipient.rb', line 3 def custom_id @custom_id end |
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/survey_monkey/recipient.rb', line 3 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
3 4 5 |
# File 'lib/survey_monkey/recipient.rb', line 3 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/survey_monkey/recipient.rb', line 3 def last_name @last_name end |
Instance Method Details
#to_hash ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/survey_monkey/recipient.rb', line 13 def to_hash hash = Hash.new hash["email"] = email unless email.nil? hash["first_name"] = first_name unless first_name.nil? hash["last_name"] = last_name unless last_name.nil? hash["custom_id"] = custom_id unless custom_id.nil? hash end |