Sha256: b9a777ff28d3c9b6fdbe10e2db000e5f4646d341d36b259744fb37a35af6808f

Contents?: true

Size: 277 Bytes

Versions: 5

Compression:

Stored size: 277 Bytes

Contents

module Metamagic
  class CustomTag < Tag
    attr_reader :render_proc

    def initialize(context, key, value, render_proc)
      super(context, key, value)
      @render_proc = render_proc
    end

    def to_html
      instance_exec key, value, &render_proc
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
metamagic-3.0.1 lib/metamagic/tags/custom_tag.rb
metamagic-3.0.0 lib/metamagic/tags/custom_tag.rb
metamagic-3.0.0.beta3 lib/metamagic/tags/custom_tag.rb
metamagic-3.0.0.beta2 lib/metamagic/tags/custom_tag.rb
metamagic-3.0.0.beta1 lib/metamagic/tags/custom_tag.rb