Class: Madness::Rendering::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/madness/rendering/handler.rb

Constant Summary collapse

HANDLERS =
{
  redcarpet: Redcarpet,
  pandoc:    Pandoc,
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(selector) ⇒ Handler

Returns a new instance of Handler.



14
# File 'lib/madness/rendering/handler.rb', line 14

def initialize(selector) = @selector = selector&.to_sym || :redcarpet

Instance Attribute Details

#selectorObject (readonly)

Returns the value of attribute selector.



12
13
14
# File 'lib/madness/rendering/handler.rb', line 12

def selector
  @selector
end

Instance Method Details

#render(text) ⇒ Object



15
# File 'lib/madness/rendering/handler.rb', line 15

def render(text) = handler.render(text)