Class: ActiveMail::Components::MenuItem

Inherits:
Base
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/activemail/components/menu_item.rb

Constant Summary

Constants inherited from Base

Base::IGNORED_ON_PASSTHROUGH, Base::TABLE_RESET

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ActiveMail::Components::Base

Instance Method Details

#transform(node, inner) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/activemail/components/menu_item.rb', line 12

def transform(node, inner)
  attributes = combine_attributes(node, 'menu-item')
  # No href → a non-link item, not a broken <a href="">; mirrors <button>.
  content = node.attr('href') ? %(<a href="#{escape_attr(node.attr('href'))}"#{target_attribute(node)}>#{inner}</a>) : inner
  th = ::ActiveMail::Core::INTERIM_TH_TAG
  %(<#{th} #{attributes}#{style_attribute(node)}>#{content}</#{th}>)
end