Class: Mailtrap::ContactField

Inherits:
Struct
  • Object
show all
Defined in:
lib/mailtrap/contact_field.rb

Overview

Data Transfer Object for Contact Field

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#data_typeString (readonly)

The data type of the field Allowed values: text, integer, float, boolean, date

Returns:

  • (String)

    the current value of data_type



12
13
14
# File 'lib/mailtrap/contact_field.rb', line 12

def data_type
  @data_type
end

#idInteger (readonly)

The contact field ID

Returns:

  • (Integer)

    the current value of id



12
13
14
# File 'lib/mailtrap/contact_field.rb', line 12

def id
  @id
end

#merge_tagString (readonly)

Personalize your campaigns by adding a merge tag. This field will be replaced with unique contact details for each recipient (max 80 characters)

Returns:

  • (String)

    the current value of merge_tag



12
13
14
# File 'lib/mailtrap/contact_field.rb', line 12

def merge_tag
  @merge_tag
end

#nameString (readonly)

The name of the contact field (max 80 characters)

Returns:

  • (String)

    the current value of name



12
13
14
# File 'lib/mailtrap/contact_field.rb', line 12

def name
  @name
end

Instance Method Details

#to_hHash

Returns The contact field attributes as a hash.

Returns:

  • (Hash)

    The contact field attributes as a hash



14
15
16
# File 'lib/mailtrap/contact_field.rb', line 14

def to_h
  super.compact
end