Class: Card::Content::Chunk::EmailURI

Inherits:
URI show all
Defined in:
mod/core/chunk/uri.rb

Overview

FIXME: DRY, merge these two into one class

Constant Summary collapse

PREPEND_STR =
"mailto:".freeze
EMAIL =
'[a-zA-Zd](?:[-a-zA-Zd]*[a-zA-Zd])?\\@'.freeze

Constants inherited from URI

URI::REJECTED_PREFIX_RE, URI::SCHEMES

Instance Attribute Summary

Attributes inherited from URI

#link_text, #uri

Attributes inherited from Abstract

#process_chunk, #text

Instance Method Summary collapse

Methods inherited from URI

context_ok?, full_match, #interpret

Methods inherited from Abstract

#as_json, #card, context_ok?, #format, full_match, full_re, #initialize, #inspect, #interpret, #reference_code, #to_s

Constructor Details

This class inherits a constructor from Card::Content::Chunk::Abstract

Instance Method Details

#process_textObject

removes the prepended string from the unchanged match text



101
102
103
# File 'mod/core/chunk/uri.rb', line 101

def process_text
  @text = @text.sub(/^mailto:/, "")
end