Class: Card::Content::Chunk::EmailUri

Inherits:
Uri
  • Object
show all
Defined in:
lib/card/content/chunk/uri.rb

Overview

FIXME: DRY, merge these two into one class

Constant Summary collapse

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

Constants inherited from Uri

Uri::REJECTED_PREFIX_RE, Uri::SCHEMES

Instance Attribute Summary

Attributes inherited from Uri

#link_text, #uri

Instance Method Summary collapse

Methods inherited from Uri

context_ok?, full_match, #interpret

Instance Method Details

#process_textObject

removes the prepended string from the unchanged match text



105
106
107
# File 'lib/card/content/chunk/uri.rb', line 105

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