Class: Repubmark::Elems::Special

Inherits:
Base
  • Object
show all
Defined in:
lib/repubmark/elems/special.rb

Overview

TODO: maybe don't allow mdash everywhere

Constant Summary collapse

HTML =
{
  ellipsis: '…',
  mdash: '—',
}.freeze
UNICODE =
{
  ellipsis: '',
  mdash: '',
}.freeze

Instance Attribute Summary

Attributes inherited from Base

#parent

Instance Method Summary collapse

Methods inherited from Base

#absolute_url, #config, #count_words, #html_class, #own_url, parent?, parents, #relative_url, #word_count

Constructor Details

#initialize(parent, name) ⇒ Special

Returns a new instance of Special.



19
20
21
22
23
24
# File 'lib/repubmark/elems/special.rb', line 19

def initialize(parent, name)
  super parent
  name = String(name).to_sym.freeze
  HTML.fetch name
  @name = name
end

Instance Method Details

#to_gemtextObject



34
# File 'lib/repubmark/elems/special.rb', line 34

def to_gemtext = UNICODE.fetch @name

#to_htmlObject



32
# File 'lib/repubmark/elems/special.rb', line 32

def to_html = HTML.fetch @name

#to_summary_plainObject

Basic methods #



30
# File 'lib/repubmark/elems/special.rb', line 30

def to_summary_plain = UNICODE.fetch @name