Class: Warped::Emails::Align

Inherits:
Base
  • Object
show all
Defined in:
lib/warped/emails/components/align.rb

Instance Attribute Summary

Attributes inherited from Base

#view_context

Instance Method Summary collapse

Methods inherited from Base

#content, #helpers, #render_in

Methods included from Styleable

#base_styles, #default_variants, included, #style, #variants

Methods included from Slottable

included, #slots

Constructor Details

#initialize(align: :left) ⇒ Align

Returns a new instance of Align.

Raises:

  • (ArgumentError)


10
11
12
13
14
# File 'lib/warped/emails/components/align.rb', line 10

def initialize(align: :left)
  super()
  @align = align
  raise ArgumentError, "Invalid alignment: #{align}" unless %i[left center right].include?(align)
end

Instance Method Details

#templateObject



16
17
18
# File 'lib/warped/emails/components/align.rb', line 16

def template
  tag.div(content, style:)
end