Class: String

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

Instance Method Summary collapse

Instance Method Details

Transform the current string into a permalink.



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

def to_permalink
  self.gsub(/\W+/, ' ').strip.downcase.titleize.gsub(/\ +/, '_')
end

#to_uriObject

Give a URI object created from the current string



8
9
10
# File 'lib/core_ext/string.rb', line 8

def to_uri
  N::URI.new(self)
end