class SlackTransformer::Slack

Constants

TRANSFORMERS

Attributes

input[R]

Public Class Methods

new(input) click to toggle source
# File lib/slack_transformer/slack.rb, line 23
def initialize(input)
  @input = input
end

Public Instance Methods

to_html() click to toggle source
# File lib/slack_transformer/slack.rb, line 27
def to_html
  html = TRANSFORMERS.reduce(input) do |working_html, transformer|
    transformer.new(working_html).to_html
  end

  "<p>#{html.gsub("\n", '<br>')}</p>"
end