Class: Tagz::Namespace::Document
- Defined in:
- lib/tagz.rb
Class Method Summary collapse
Instance Method Summary collapse
- #+(other) ⇒ Object
- #<<(obj) ⇒ Object
- #concat(obj) ⇒ Object
- #document ⇒ Object (also: #doc)
- #element ⇒ Object (also: #e)
- #escape(string) ⇒ Object (also: #h)
- #push ⇒ Object
- #puts(string) ⇒ Object
- #raw(string) ⇒ Object
- #to_s ⇒ Object
- #to_str ⇒ Object
- #write ⇒ Object
Methods inherited from HTMLSafe
Class Method Details
Instance Method Details
#+(other) ⇒ Object
291 292 293 |
# File 'lib/tagz.rb', line 291 def + other self.dup << other end |
#<<(obj) ⇒ Object
259 260 261 262 263 264 265 266 267 |
# File 'lib/tagz.rb', line 259 def << obj if obj.respond_to?(:html_safe?) and obj.html_safe? super obj.to_s else super Tagz.escape_content(obj) end self end |
#concat(obj) ⇒ Object
269 270 271 |
# File 'lib/tagz.rb', line 269 def concat(obj) self << obj end |
#document ⇒ Object Also known as: doc
286 287 288 |
# File 'lib/tagz.rb', line 286 def document self end |
#element ⇒ Object Also known as: e
251 252 253 |
# File 'lib/tagz.rb', line 251 def element Tagz.element.new(*a, &b) end |
#escape(string) ⇒ Object Also known as: h
273 274 275 |
# File 'lib/tagz.rb', line 273 def escape(string) Tagz.escape(string) end |
#push ⇒ Object
257 |
# File 'lib/tagz.rb', line 257 alias_method 'push', 'concat' |
#puts(string) ⇒ Object
278 279 280 |
# File 'lib/tagz.rb', line 278 def puts(string) write "#{ string }\n" end |
#raw(string) ⇒ Object
282 283 284 |
# File 'lib/tagz.rb', line 282 def raw(string) push Document.for(string) end |
#to_s ⇒ Object
295 296 297 |
# File 'lib/tagz.rb', line 295 def to_s self end |
#to_str ⇒ Object
299 300 301 |
# File 'lib/tagz.rb', line 299 def to_str self end |
#write ⇒ Object
256 |
# File 'lib/tagz.rb', line 256 alias_method 'write', 'concat' |