Class: Courier::Models::ElementalTextNode

Inherits:
ElementalBaseNode show all
Defined in:
lib/courier/models/elemental_text_node.rb,
sig/courier/models/elemental_text_node.rbs

Direct Known Subclasses

ElementalTextNodeWithType

Defined Under Namespace

Modules: Align, Format

Instance Attribute Summary collapse

Attributes inherited from ElementalBaseNode

#channels, #if_, #loop_, #ref

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(align: nil, bold: nil, color: nil, content: nil, font_size: nil, format_: nil, italic: nil, line_height: nil, locales: nil, strikethrough: nil, text_style: nil, underline: nil) ⇒ Object

Some parameter documentations has been truncated, see Courier::Models::ElementalTextNode for more details.

Represents a body of text to be rendered inside of the notification.

Parameters:

  • align (Symbol, Courier::Models::ElementalTextNode::Align) (defaults to: nil)

    Text alignment.

  • bold (String, nil) (defaults to: nil)

    Apply bold to the text

  • color (String, nil) (defaults to: nil)

    Specifies the color of text. Can be any valid css color value

  • content (String) (defaults to: nil)

    The text content displayed in the notification. Either this

  • font_size (String, nil) (defaults to: nil)

    CSS px font size for this text block, e.g. 16px. Overrides the size of the `te

  • format_ (Symbol, Courier::Models::ElementalTextNode::Format, nil) (defaults to: nil)
  • italic (String, nil) (defaults to: nil)

    Apply italics to the text

  • line_height (String, nil) (defaults to: nil)

    CSS line height for this text block, as a px value or a unitless multiplier, e.g

  • locales (Hash{Symbol=>Courier::Models::LocaleItem}, nil) (defaults to: nil)

    Region specific content. See [locales docs](https://www.courier.com/docs/platfor

  • strikethrough (String, nil) (defaults to: nil)

    Apply a strike through the text

  • text_style (Symbol, Courier::Models::TextStyle, nil) (defaults to: nil)

    Allows the text to be rendered as a heading level.

  • underline (String, nil) (defaults to: nil)

    Apply an underline to the text



# File 'lib/courier/models/elemental_text_node.rb', line 82

Instance Attribute Details

#alignSymbol, ...

Text alignment.



10
# File 'lib/courier/models/elemental_text_node.rb', line 10

optional :align, enum: -> { Courier::ElementalTextNode::Align }

#boldString?

Apply bold to the text

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


16
# File 'lib/courier/models/elemental_text_node.rb', line 16

optional :bold, String, nil?: true

#colorString?

Specifies the color of text. Can be any valid css color value

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


22
# File 'lib/courier/models/elemental_text_node.rb', line 22

optional :color, String, nil?: true

#contentString?

The text content displayed in the notification. Either this field must be specified, or the elements field

Parameters:

  • _ (String)

Returns:

  • (String, nil)


29
# File 'lib/courier/models/elemental_text_node.rb', line 29

optional :content, String

#font_sizeString?

CSS px font size for this text block, e.g. 16px. Overrides the size of the text_style preset. Email only.

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


36
# File 'lib/courier/models/elemental_text_node.rb', line 36

optional :font_size, String, nil?: true

#format_Symbol, ...



41
# File 'lib/courier/models/elemental_text_node.rb', line 41

optional :format_, enum: -> { Courier::ElementalTextNode::Format }, api_name: :format, nil?: true

#italicString?

Apply italics to the text

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


47
# File 'lib/courier/models/elemental_text_node.rb', line 47

optional :italic, String, nil?: true

#line_heightString?

CSS line height for this text block, as a px value or a unitless multiplier, e.g. 24px or 1.5. Email only.

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


54
# File 'lib/courier/models/elemental_text_node.rb', line 54

optional :line_height, String, nil?: true

#localesHash{Symbol=>Courier::Models::LocaleItem}?

Region specific content. See locales docs for more details.

Parameters:

  • _ (Courier::Models::locales, nil)

Returns:



62
# File 'lib/courier/models/elemental_text_node.rb', line 62

optional :locales, -> { Courier::Internal::Type::HashOf[Courier::LocaleItem] }, nil?: true

#strikethroughString?

Apply a strike through the text

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


68
# File 'lib/courier/models/elemental_text_node.rb', line 68

optional :strikethrough, String, nil?: true

#text_styleSymbol, ...

Allows the text to be rendered as a heading level.

Returns:



74
# File 'lib/courier/models/elemental_text_node.rb', line 74

optional :text_style, enum: -> { Courier::TextStyle }, nil?: true

#underlineString?

Apply an underline to the text

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


80
# File 'lib/courier/models/elemental_text_node.rb', line 80

optional :underline, String, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/courier/models/elemental_text_node.rb', line 120

Instance Method Details

#to_hash{

Returns:

  • ({)


89
# File 'sig/courier/models/elemental_text_node.rbs', line 89

def to_hash: -> {