High level abstract tag form, transformed by formatters into the lower level Tag
form (or an array of them).
Attributes
Public Class methods
new(form, type, opts={})
Set the form
, type
, and opts
.
[show source]
# File lib/forme/input.rb 20 def initialize(form, type, opts={}) 21 @form, @type = form, type 22 defaults = form.input_defaults 23 @opts = (defaults.fetch(type){defaults[type.to_s]} || {}).merge(opts) 24 @form_opts = form.opts 25 end
Public Instance methods
format()
Transform the receiver into a lower level Tag
form (or an array of them).
[show source]
# File lib/forme/input.rb 40 def format 41 Forme.transform(:formatter, @opts, @form_opts, self) 42 end
tag(*a, &block)
Create a new Tag
instance with the given arguments and block related to the receiver’s form
.
[show source]
# File lib/forme/input.rb 29 def tag(*a, &block) 30 form._tag(*a, &block) 31 end
to_s()
Return a string containing the serialized content of the receiver.
[show source]
# File lib/forme/input.rb 34 def to_s 35 Forme.transform(:serializer, @opts, @form_opts, self) 36 end