Class: QuestionproRails::EmailList
- Inherits:
-
Object
- Object
- QuestionproRails::EmailList
- Defined in:
- lib/questionpro_rails/email_list.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#bounced ⇒ Object
readonly
Returns the value of attribute bounced.
-
#email_group_id ⇒ Object
readonly
Returns the value of attribute email_group_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pendin_verification ⇒ Object
readonly
Returns the value of attribute pendin_verification.
-
#qp_emails ⇒ Array<String>
readonly
Emails.
-
#qp_statistics ⇒ Hash
readonly
Email list statistics.
-
#survey_id ⇒ Object
readonly
Returns the value of attribute survey_id.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
-
#unsubscribed ⇒ Object
readonly
Returns the value of attribute unsubscribed.
Instance Method Summary collapse
-
#emails ⇒ Array<String>
Extract and seperate emails from qp_emails.
-
#initialize(attributes) ⇒ EmailList
constructor
A new instance of EmailList.
-
#statistics ⇒ QuestionproRails::EmailListStatistic
Extract the email list statistics from qp_statistics attribute.
Constructor Details
#initialize(attributes) ⇒ EmailList
Returns a new instance of EmailList.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/questionpro_rails/email_list.rb', line 15 def initialize (attributes) @survey_id = attributes['surveyID'] @email_group_id = attributes['emailGroupID'] @name = attributes['name'] @qp_emails = attributes['email'] @qp_statistics = attributes['statistics'] @unsubscribed = attributes['unsubscribed'] @total = attributes['total'] @active = attributes['active'] @pendin_verification = attributes['pendinVerification'] @bounced = attributes['bounced'] end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
6 7 8 |
# File 'lib/questionpro_rails/email_list.rb', line 6 def active @active end |
#bounced ⇒ Object (readonly)
Returns the value of attribute bounced.
6 7 8 |
# File 'lib/questionpro_rails/email_list.rb', line 6 def bounced @bounced end |
#email_group_id ⇒ Object (readonly)
Returns the value of attribute email_group_id.
6 7 8 |
# File 'lib/questionpro_rails/email_list.rb', line 6 def email_group_id @email_group_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/questionpro_rails/email_list.rb', line 6 def name @name end |
#pendin_verification ⇒ Object (readonly)
Returns the value of attribute pendin_verification.
6 7 8 |
# File 'lib/questionpro_rails/email_list.rb', line 6 def pendin_verification @pendin_verification end |
#qp_emails ⇒ Array<String> (readonly)
Returns Emails.
10 11 12 |
# File 'lib/questionpro_rails/email_list.rb', line 10 def qp_emails @qp_emails end |
#qp_statistics ⇒ Hash (readonly)
Returns Email list statistics.
13 14 15 |
# File 'lib/questionpro_rails/email_list.rb', line 13 def qp_statistics @qp_statistics end |
#survey_id ⇒ Object (readonly)
Returns the value of attribute survey_id.
6 7 8 |
# File 'lib/questionpro_rails/email_list.rb', line 6 def survey_id @survey_id end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
6 7 8 |
# File 'lib/questionpro_rails/email_list.rb', line 6 def total @total end |
#unsubscribed ⇒ Object (readonly)
Returns the value of attribute unsubscribed.
6 7 8 |
# File 'lib/questionpro_rails/email_list.rb', line 6 def unsubscribed @unsubscribed end |
Instance Method Details
#emails ⇒ Array<String>
Extract and seperate emails from qp_emails.
44 45 46 47 48 |
# File 'lib/questionpro_rails/email_list.rb', line 44 def emails unless self.qp_emails.nil? return self.qp_emails.split(',') end end |
#statistics ⇒ QuestionproRails::EmailListStatistic
Extract the email list statistics from qp_statistics attribute.
31 32 33 34 35 36 37 38 39 |
# File 'lib/questionpro_rails/email_list.rb', line 31 def statistics extracted_statistics = [] unless self.qp_statistics.nil? extracted_statistics.push(EmailListStatistic.new(qp_statistics)) end return extracted_statistics end |