Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/diglossa/classext.rb
Overview
module Diglossa
Instance Method Summary collapse
- #to_defis ⇒ Object
- #to_space ⇒ Object
- #to_underscore ⇒ Object
-
#to_url ⇒ Object
aka path_to_url.
Instance Method Details
#to_defis ⇒ Object
4 5 6 |
# File 'lib/diglossa/classext.rb', line 4 def to_defis self.gsub('_', '-').gsub(' ', '-') end |
#to_space ⇒ Object
12 13 14 |
# File 'lib/diglossa/classext.rb', line 12 def to_space self.gsub('_', ' ').gsub('-', ' ') end |
#to_underscore ⇒ Object
8 9 10 |
# File 'lib/diglossa/classext.rb', line 8 def to_underscore self.gsub(' ', '_').gsub('-', '_') end |
#to_url ⇒ Object
aka path_to_url
16 17 18 |
# File 'lib/diglossa/classext.rb', line 16 def to_url # aka path_to_url self.split('/')[1..-1].join('/').to_defis end |