Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/newsfetcher/extensions/string.rb

Instance Method Summary collapse

Instance Method Details

#html?Boolean



3
4
5
# File 'lib/newsfetcher/extensions/string.rb', line 3

def html?
  self =~ /(<[a-z]+)|(\&\S+;)/i
end

#to_htmlObject



7
8
9
10
11
12
13
# File 'lib/newsfetcher/extensions/string.rb', line 7

def to_html
  if html?
    self
  else
    RubyPants.new(self).to_html
  end
end