Sha256: 482c33058cd58496a93754e26da63f492e54300525db691b7b30e41b9e950047

Contents?: true

Size: 335 Bytes

Versions: 7

Compression:

Stored size: 335 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 remove_prefix?
      false
    end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
metamagic-3.1.7 lib/metamagic/tags/custom_tag.rb
metamagic-3.1.6 lib/metamagic/tags/custom_tag.rb
metamagic-3.1.5 lib/metamagic/tags/custom_tag.rb
metamagic-3.1.4 lib/metamagic/tags/custom_tag.rb
metamagic-3.1.3 lib/metamagic/tags/custom_tag.rb
metamagic-3.1.2 lib/metamagic/tags/custom_tag.rb
metamagic-3.1.1 lib/metamagic/tags/custom_tag.rb