Class: Forme::Wrapper::Tag

Inherits:
Forme::Wrapper show all
Defined in:
lib/forme/transformers/wrapper.rb

Overview

Wraps inputs using the given tag type.

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Tag

Set the tag type to use.



15
16
17
# File 'lib/forme/transformers/wrapper.rb', line 15

def initialize(type)
  @type = type
end

Instance Method Details

#call(tag, input) ⇒ Object

Wrap the input in the tag of the given type.



20
21
22
# File 'lib/forme/transformers/wrapper.rb', line 20

def call(tag, input)
  input.tag(@type, input.opts[:wrapper_attr], super)
end