Low level abstract tag form, where each instance represents an HTML tag with attributes and children.
Attributes
Public Class methods
new(form, type, attr={}, children=nil)
Set the form
, type
, attr
, and children
.
[show source]
# File lib/forme/tag.rb 21 def initialize(form, type, attr={}, children=nil) 22 @form, @type, @attr = form, type, (attr||{}) 23 @children = parse_children(children) 24 end
Public Instance methods
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/tag.rb 28 def tag(*a, &block) 29 form._tag(*a, &block) 30 end
to_s()
Return a string containing the serialized content of the receiver.
[show source]
# File lib/forme/tag.rb 33 def to_s 34 Forme.transform(:serializer, @opts, @form.opts, self) 35 end