Class: Metamagic::CustomTag

Inherits:
Tag
  • Object
show all
Defined in:
lib/metamagic/tags/custom_tag.rb

Instance Attribute Summary collapse

Attributes inherited from Tag

#context, #key, #value

Instance Method Summary collapse

Methods inherited from Tag

#<=>, #==, #interpolated_values, #method_missing, #sort_order, #template

Constructor Details

#initialize(context, key, value, render_proc) ⇒ CustomTag

Returns a new instance of CustomTag.



5
6
7
8
# File 'lib/metamagic/tags/custom_tag.rb', line 5

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Metamagic::Tag

Instance Attribute Details

#render_procObject (readonly)

Returns the value of attribute render_proc.



3
4
5
# File 'lib/metamagic/tags/custom_tag.rb', line 3

def render_proc
  @render_proc
end

Instance Method Details

#remove_prefix?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/metamagic/tags/custom_tag.rb', line 10

def remove_prefix?
  false
end

#to_htmlObject



14
15
16
# File 'lib/metamagic/tags/custom_tag.rb', line 14

def to_html
  instance_exec key, interpolated_values, &render_proc
end