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

Inherits:
Uri show all
Defined in:
mod/content/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

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, #burn_after_reading, #burn_read, #card, context_ok?, #format, full_match, full_re, #initialize, #inspect, #interpret, #reference_code, #result, #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



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

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