Class: Workarea::Listrak::Models::ContactForm
- Inherits:
-
Object
- Object
- Workarea::Listrak::Models::ContactForm
- Defined in:
- app/services/workarea/listrak/models/contact_form.rb
Constant Summary collapse
- SUBSCRIBED_STATES =
['Subscribed', 'Unsubscribed']
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#subscription_state ⇒ Object
readonly
Returns the value of attribute subscription_state.
Instance Method Summary collapse
-
#initialize(email:, subscription_state: nil, **options) ⇒ ContactForm
constructor
A new instance of ContactForm.
- #to_json ⇒ Object
Constructor Details
#initialize(email:, subscription_state: nil, **options) ⇒ ContactForm
Returns a new instance of ContactForm.
8 9 10 11 12 |
# File 'app/services/workarea/listrak/models/contact_form.rb', line 8 def initialize(email:, subscription_state: nil, **) @email = email @subscription_state = subscription_state.presence_in SUBSCRIBED_STATES @options = end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
6 7 8 |
# File 'app/services/workarea/listrak/models/contact_form.rb', line 6 def email @email end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'app/services/workarea/listrak/models/contact_form.rb', line 6 def @options end |
#subscription_state ⇒ Object (readonly)
Returns the value of attribute subscription_state.
6 7 8 |
# File 'app/services/workarea/listrak/models/contact_form.rb', line 6 def subscription_state @subscription_state end |
Instance Method Details
#to_json ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/services/workarea/listrak/models/contact_form.rb', line 14 def to_json { emailAddress: email, subscriptionState: subscription_state, segmentationFieldValues: nil }.to_json end |