Class: String

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

Instance Method Summary collapse

Instance Method Details

#to_onObject



2
3
4
5
6
7
8
9
10
# File 'lib/onify/string.rb', line 2

def to_on
  if self[-2,2] == "on"
    self
  elsif self[-3,2] == "on"
    self[0..-2]
  else
    self + "on"
  end
end