Class: Markbridge::Parsers::TextFormatter::Handlers::EmailHandler
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- Markbridge::Parsers::TextFormatter::Handlers::EmailHandler
- Defined in:
- lib/markbridge/parsers/text_formatter/handlers/email_handler.rb
Overview
Handler for EMAIL elements in s9e/TextFormatter XML
Instance Attribute Summary collapse
-
#element_class ⇒ Object
readonly
Returns the value of attribute element_class.
Instance Method Summary collapse
-
#initialize ⇒ EmailHandler
constructor
A new instance of EmailHandler.
- #process(element:, parent:) ⇒ Object
Constructor Details
#initialize ⇒ EmailHandler
Returns a new instance of EmailHandler.
9 10 11 |
# File 'lib/markbridge/parsers/text_formatter/handlers/email_handler.rb', line 9 def initialize @element_class = AST::Email end |
Instance Attribute Details
#element_class ⇒ Object (readonly)
Returns the value of attribute element_class.
22 23 24 |
# File 'lib/markbridge/parsers/text_formatter/handlers/email_handler.rb', line 22 def element_class @element_class end |
Instance Method Details
#process(element:, parent:) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/markbridge/parsers/text_formatter/handlers/email_handler.rb', line 13 def process(element:, parent:) attrs = extract_attributes(element) node = AST::Email.new(address: attrs[:email]) parent << node # Return node to signal: process children into this node node end |