Class: Workarea::Listrak::Models::TransactionalMessageForm

Inherits:
Object
  • Object
show all
Defined in:
app/services/workarea/listrak/models/transactional_message_form.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email_address:, segmentation_field_values: []) ⇒ TransactionalMessageForm

Returns a new instance of TransactionalMessageForm.



7
8
9
10
# File 'app/services/workarea/listrak/models/transactional_message_form.rb', line 7

def initialize(email_address:, segmentation_field_values: [])
  @email_address = email_address
  @segmentation_field_values = segmentation_field_values
end

Instance Attribute Details

#email_addressObject (readonly)

Returns the value of attribute email_address.



5
6
7
# File 'app/services/workarea/listrak/models/transactional_message_form.rb', line 5

def email_address
  @email_address
end

#segmentation_field_valuesObject (readonly)

Returns the value of attribute segmentation_field_values.



5
6
7
# File 'app/services/workarea/listrak/models/transactional_message_form.rb', line 5

def segmentation_field_values
  @segmentation_field_values
end

Instance Method Details

#to_jsonObject



12
13
14
15
16
17
# File 'app/services/workarea/listrak/models/transactional_message_form.rb', line 12

def to_json
  {
    emailAddress: email_address,
    segmentationFieldValues: segmentation_field_values
  }.compact.to_json
end