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
290 291 292 |
# File 'lib/tagz.rb', line 290 def + other self.dup << other end |
#<<(obj) ⇒ Object
258 259 260 261 262 263 264 265 266 |
# File 'lib/tagz.rb', line 258 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
268 269 270 |
# File 'lib/tagz.rb', line 268 def concat(obj) self << obj end |
#document ⇒ Object Also known as: doc
285 286 287 |
# File 'lib/tagz.rb', line 285 def document self end |
#element ⇒ Object Also known as: e
250 251 252 |
# File 'lib/tagz.rb', line 250 def element Tagz.element.new(*a, &b) end |
#escape(string) ⇒ Object Also known as: h
272 273 274 |
# File 'lib/tagz.rb', line 272 def escape(string) Tagz.escape(string) end |
#push ⇒ Object
256 |
# File 'lib/tagz.rb', line 256 alias_method 'push', 'concat' |
#puts(string) ⇒ Object
277 278 279 |
# File 'lib/tagz.rb', line 277 def puts(string) write "#{ string }\n" end |
#raw(string) ⇒ Object
281 282 283 |
# File 'lib/tagz.rb', line 281 def raw(string) push Document.for(string) end |
#to_s ⇒ Object
294 295 296 |
# File 'lib/tagz.rb', line 294 def to_s self end |
#to_str ⇒ Object
298 299 300 |
# File 'lib/tagz.rb', line 298 def to_str self end |
#write ⇒ Object
255 |
# File 'lib/tagz.rb', line 255 alias_method 'write', 'concat' |