Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/bewildr/ext/extensions.rb

Overview

removes need for active support

Instance Method Summary collapse

Instance Method Details

#bewildr_classifyObject

Kinda like classify from active support, but does only what’s needed by bewildr



20
21
22
# File 'lib/bewildr/ext/extensions.rb', line 20

def bewildr_classify
  self.split("_").collect {|word| "#{word[0].upcase}#{word[1..-1]}"}.join
end

#bewildr_demodulizeObject

directly stolen from active support - takes the module bit off a class name



15
16
17
# File 'lib/bewildr/ext/extensions.rb', line 15

def bewildr_demodulize
  gsub(/^.*::/, '')
end