module Listlee
Constants
- VERSION
Public Instance Methods
ul(array)
click to toggle source
# File lib/listlee.rb, line 7 def ul(array) list = array.map { |x| tag(:li, escape(x)) }.join tag(:ul, list) end
Private Instance Methods
escape(string, entities = :named)
click to toggle source
# File lib/listlee.rb, line 18 def escape(string, entities = :named) coder = HTMLEntities.new coder.encode(string, entities) end
tag(element, string)
click to toggle source
# File lib/listlee.rb, line 14 def tag(element, string) "<#{ element }>#{ string }</#{ element }>" end