Sha256: 875c70abc867bee261e4697019f6dbc1297a2f513b7d7ef4e458b93989d23d90

Contents?: true

Size: 581 Bytes

Versions: 1

Compression:

Stored size: 581 Bytes

Contents

module WrapIt
  #
  # TextContainer
  #
  # @author Alexey Ovchinnikov <alexiss@cybernetlab.ru>
  #
  module TextContainer
    def self.included(base)
      base.class_eval do
        default_tag 'p', false

        after_initialize do
          @body = @arguments.extract_first!(String) || empty_html
          @body += @options[:body] || @options[:text] || empty_html
          @options.delete(:body)
          @options.delete(:text)
        end

        after_capture do
          @content = html_safe(@body) + @content unless @body.nil?
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wrap_it-0.1.5 lib/wrap_it/text_container.rb