Class: Livetext::Functions
- Inherits:
-
Object
- Object
- Livetext::Functions
- Defined in:
- lib/liveblog.rb,
lib/liveblog.rb
Overview
experimental…
Instance Method Summary collapse
- #_var(name) ⇒ Object
- #br(n = "1") ⇒ Object
- #h1(param) ⇒ Object
- #h2(param) ⇒ Object
- #h3(param) ⇒ Object
- #h4(param) ⇒ Object
- #h5(param) ⇒ Object
- #h6(param) ⇒ Object
- #hr(param = nil) ⇒ Object
- #image(param) ⇒ Object
- #link ⇒ Object
Instance Method Details
#_var(name) ⇒ Object
391 392 393 |
# File 'lib/liveblog.rb', line 391 def _var(name) ::Livetext::Vars[name] || "[:#{name} is undefined]" end |
#br(n = "1") ⇒ Object
364 365 366 367 368 369 |
# File 'lib/liveblog.rb', line 364 def br(n="1") # Thought: Maybe make a way for functions to "simply" call the # dot command of the same name?? Is this trivial?? n = n.empty? ? 1 : n.to_i "<br>"*n end |
#h1(param) ⇒ Object
371 |
# File 'lib/liveblog.rb', line 371 def h1(param); "<h1>#{param}</h1>"; end |
#h2(param) ⇒ Object
372 |
# File 'lib/liveblog.rb', line 372 def h2(param); "<h2>#{param}</h2>"; end |
#h3(param) ⇒ Object
373 |
# File 'lib/liveblog.rb', line 373 def h3(param); "<h3>#{param}</h3>"; end |
#h4(param) ⇒ Object
374 |
# File 'lib/liveblog.rb', line 374 def h4(param); "<h4>#{param}</h4>"; end |
#h5(param) ⇒ Object
375 |
# File 'lib/liveblog.rb', line 375 def h5(param); "<h5>#{param}</h5>"; end |
#h6(param) ⇒ Object
376 |
# File 'lib/liveblog.rb', line 376 def h6(param); "<h6>#{param}</h6>"; end |
#hr(param = nil) ⇒ Object
378 379 380 |
# File 'lib/liveblog.rb', line 378 def hr(param=nil) $Dot.hr end |
#image(param) ⇒ Object
382 383 384 |
# File 'lib/liveblog.rb', line 382 def image(param) "<img src='#{param}'></img>" end |
#link ⇒ Object
395 396 397 398 |
# File 'lib/liveblog.rb', line 395 def link file, cdata = self.class.param.split("||", 2) %[<link type="application/atom+xml" rel="alternate" href="#{_var(:host)}#{file}" title="#{_var(:title)}">] end |