Class: Courier::Models::ElementalImageNode

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

Direct Known Subclasses

ElementalImageNodeWithType

Instance Attribute Summary collapse

Attributes inherited from ElementalBaseNode

#channels, #if_, #loop_, #ref

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(src:, align: nil, alt_text: nil, border_color: nil, border_size: nil, href: nil, padding: nil, width: nil) ⇒ Object

Used to embed an image into the notification.

Parameters:

  • src (String)

    The source of the image.

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

    The alignment of the image.

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

    Alternate text for the image.

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

    CSS border color applied to the image. For example, #ccc

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

    CSS border width applied to the image. For example, 1px

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

    A URL to link to when the image is clicked.

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

    CSS padding applied around the image. For example, 10px

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

    CSS width properties to apply to the image. For example, 50px



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

Instance Attribute Details

#alignSymbol, ...

The alignment of the image.

Parameters:

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

Returns:



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

optional :align, enum: -> { Courier::Alignment }, nil?: true

#alt_textString?

Alternate text for the image.

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


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

optional :alt_text, String, nil?: true

#border_colorString?

CSS border color applied to the image. For example, #ccc

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


28
# File 'lib/courier/models/elemental_image_node.rb', line 28

optional :border_color, String, nil?: true

#border_sizeString?

CSS border width applied to the image. For example, 1px

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


34
# File 'lib/courier/models/elemental_image_node.rb', line 34

optional :border_size, String, nil?: true

#hrefString?

A URL to link to when the image is clicked.

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


40
# File 'lib/courier/models/elemental_image_node.rb', line 40

optional :href, String, nil?: true

#paddingString?

CSS padding applied around the image. For example, 10px

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


46
# File 'lib/courier/models/elemental_image_node.rb', line 46

optional :padding, String, nil?: true

#srcString

The source of the image.

Parameters:

  • _ (String)

Returns:

  • (String)


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

required :src, String

#widthString?

CSS width properties to apply to the image. For example, 50px

Parameters:

  • _ (String, nil)

Returns:

  • (String, nil)


52
# File 'lib/courier/models/elemental_image_node.rb', line 52

optional :width, String, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


59
# File 'sig/courier/models/elemental_image_node.rbs', line 59

def to_hash: -> {