Class: CreateEmailVariants
- Inherits:
-
Scrivener
- Object
- Scrivener
- CreateEmailVariants
- Defined in:
- lib/shareprogress/filters/create_email_variants.rb
Instance Attribute Summary collapse
-
#button_template ⇒ Object
Returns the value of attribute button_template.
-
#email ⇒ Object
Returns the value of attribute email.
Instance Method Summary collapse
Instance Attribute Details
#button_template ⇒ Object
Returns the value of attribute button_template.
2 3 4 |
# File 'lib/shareprogress/filters/create_email_variants.rb', line 2 def @button_template end |
#email ⇒ Object
Returns the value of attribute email.
2 3 4 |
# File 'lib/shareprogress/filters/create_email_variants.rb', line 2 def email @email end |
Instance Method Details
#validate ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/shareprogress/filters/create_email_variants.rb', line 4 def validate assert_member :button_template, %w{sp_em_small sp_em_large} if assert_present :email email.each do |e| if assert !e["email_subject"].nil?, [:email_subject, :nil] assert !e["email_subject"].empty?, [:email_subject, :empty] end if assert !e["email_body"].nil?, [:email_body, :nil] if assert !e["email_body"].empty?, [:email_body, :empty] assert e["email_body"].include?("{LINK}"), [:email_body, :link_not_included] end end end end end |