class Textp::HtmlHelper

Public Class Methods

new(text) click to toggle source
# File lib/textp/html_helper.rb, line 7
def initialize(text)
  @text     = text
  @parser   = Parser.new(text)
end

Public Instance Methods

parser() click to toggle source
# File lib/textp/html_helper.rb, line 30
def parser
  @parser
end
replacement_content() click to toggle source
# File lib/textp/html_helper.rb, line 41
def replacement_content
  content = @text
  @parser.links.each do |link|
    html_content = links_content[link][:html]
    content.gsub!(link, html_content)
  end
  content
end
response() click to toggle source
# File lib/textp/html_helper.rb, line 34
def response
  json_string = {
    :links => @parser.links,
    :oembed_data => links_content
  }.to_json
end