Sha256: 00e1712260820b15cb10c110287bbbfc725ca2fbd645590d89c1b620621cf681

Contents?: true

Size: 500 Bytes

Versions: 1

Compression:

Stored size: 500 Bytes

Contents

require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/module/attribute_accessors'

module AutoHtml
  extend self

  def self.add_filter(name, &block)
    AutoHtml::Builder.add_filter(name, &block)
  end

  def auto_html(raw, options = {}, &proc)
    return "" if raw.blank?
    builder = Builder.new(raw, options)
    result = builder.instance_eval(&proc)
    return raw if result.nil?
    result.respond_to?(:html_safe) ?
      result.html_safe :
        result
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
auto_html-whistlerbrk-2.0.0.pre lib/auto_html/base.rb