Module: TypographerHelper

Defined in:
lib/typographer.rb,
lib/typographer/version.rb,
lib/typographer/parsers/basic.rb,
lib/typographer/parsers/simple_format.rb

Defined Under Namespace

Modules: Parsers

Constant Summary collapse

GEM_NAME =
"typographer"
VERSION =
"0.5"

Class Method Summary collapse

Class Method Details

.parse(string, type = :default) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/typographer.rb', line 12

def self.parse(string, type = :default)
  @@registry[type].each do |parser|
    string = parser.parse string
  end

  string.html_safe
end

.register(name, elements) ⇒ Object



7
8
9
10
# File 'lib/typographer.rb', line 7

def self.register(name, elements)
  @@registry ||= {}
  @@registry[name.to_sym] = get_parsers elements
end