Module: SlimText

Included in:
Hpricot::Attributes, Hpricot::CData, Hpricot::Text, Hpricot::XMLDecl
Defined in:
lib/eex2slime/hpricot_monkeypatches.rb

Instance Method Summary collapse

Instance Method Details

#textifyObject

default implementation



13
14
15
# File 'lib/eex2slime/hpricot_monkeypatches.rb', line 13

def textify
  to_s
end

#to_slime(lvl = 0) ⇒ Object



7
8
9
10
# File 'lib/eex2slime/hpricot_monkeypatches.rb', line 7

def to_slime(lvl=0)
  return nil if textify.strip.empty?
  ('  ' * lvl) + %(| #{textify.gsub(/\s+/, ' ').strip})
end