Module: HTMLHelper
- Included in:
- Livetext::Standard
- Defined in:
- lib/livetext/html.rb
Instance Method Summary collapse
- #open_close_tags(*tags) ⇒ Object
-
#wrap(*tags) ⇒ Object
helper.
-
#wrapped(str, *tags) ⇒ Object
helper.
-
#wrapped!(str, tag, **extras) ⇒ Object
helper.
Instance Method Details
#open_close_tags(*tags) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/livetext/html.rb', line 24 def (*) open, close = "", "" .each do |tag| open << "<#{tag}>" close.prepend("</#{tag}>") end [open, close] end |
#wrap(*tags) ⇒ Object
helper
17 18 19 20 21 22 |
# File 'lib/livetext/html.rb', line 17 def wrap(*) # helper open, close = (*) api.out open yield api.out close end |
#wrapped(str, *tags) ⇒ Object
helper
4 5 6 7 |
# File 'lib/livetext/html.rb', line 4 def wrapped(str, *) # helper open, close = (*) open + str + close end |
#wrapped!(str, tag, **extras) ⇒ Object
helper
9 10 11 12 13 14 15 |
# File 'lib/livetext/html.rb', line 9 def wrapped!(str, tag, **extras) # helper open, close = (tag) extras.each_pair do |name, value| open.sub!(">", " #{name}='#{value}'>") end open + str + close end |