Class: Markbridge::AST::Email

Inherits:
Element show all
Defined in:
lib/markbridge/ast/email.rb

Overview

Represents an email link element.

Examples:

Email with explicit address

email = AST::Email.new(address: "[email protected]")
email << AST::Text.new("Contact us")

Email with text as address

email = AST::Email.new(address: "[email protected]")
email << AST::Text.new("[email protected]")

Instance Attribute Summary collapse

Attributes inherited from Element

#children

Instance Method Summary collapse

Methods inherited from Element

#<<

Constructor Details

#initialize(address: nil) ⇒ Email

Create a new Email element.

Parameters:

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

    the email address for this link



21
22
23
24
# File 'lib/markbridge/ast/email.rb', line 21

def initialize(address: nil)
  super()
  @address = address
end

Instance Attribute Details

#addressString? (readonly)

Returns the email address for this link.

Returns:

  • (String, nil)

    the email address for this link



16
17
18
# File 'lib/markbridge/ast/email.rb', line 16

def address
  @address
end