Class: Forme::Wrapper::Tag
- Inherits:
-
Forme::Wrapper
- Object
- Forme::Wrapper
- Forme::Wrapper::Tag
- Defined in:
- lib/forme/transformers/wrapper.rb
Overview
Wraps inputs using the given tag type.
Instance Method Summary collapse
-
#call(tag, input) ⇒ Object
Wrap the input in the tag of the given type.
-
#initialize(type) ⇒ Tag
constructor
Set the tag type to use.
Constructor Details
#initialize(type) ⇒ Tag
Set the tag type to use.
17 18 19 |
# File 'lib/forme/transformers/wrapper.rb', line 17 def initialize(type) @type = type end |
Instance Method Details
#call(tag, input) ⇒ Object
Wrap the input in the tag of the given type.
22 23 24 |
# File 'lib/forme/transformers/wrapper.rb', line 22 def call(tag, input) input.tag(@type, input.opts[:wrapper_attr], super) end |