Sha256: 4b055b283d31cc294a2a175c4767dec7ba10ccc45d8d56cd5e26f566e0db80e3

Contents?: true

Size: 771 Bytes

Versions: 5

Compression:

Stored size: 771 Bytes

Contents

module Aureus

  class Renderable
    include ActionView::Context
    include ActionView::Helpers::TagHelper
    include ActionView::Helpers::CaptureHelper
    include ActionView::Helpers::UrlHelper
    include Haml::Helpers

    def initialize content
      @content = content
    end

    def init args, *defaults
      @options = defaults.extract_options!.merge(args.extract_options!)
    end

    def content_tag name, content_or_options_with_block = nil, options = nil, escape = false, &block
      super name, content_or_options_with_block, options, escape, &block
    end

    def compact *args
      args.join.html_safe
    end

    def compact_render *args
      args.map{ |e| e.render }.join.html_safe
    end

    def render
      @content
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
aureus-2.1.4 lib/aureus/renderable.rb
aureus-2.1.3 lib/aureus/renderable.rb
aureus-2.1.2 lib/aureus/renderable.rb
aureus-2.1.1 lib/aureus/renderable.rb
aureus-2.1.0 lib/aureus/renderable.rb