Class: ConstantContact::BaseResource
- Inherits:
-
Object
- Object
- ConstantContact::BaseResource
show all
- Defined in:
- lib/constant_contact/base_resource.rb
Overview
Class Method Summary
collapse
Class Method Details
.camelize(string) ⇒ Object
6
7
8
|
# File 'lib/constant_contact/base_resource.rb', line 6
def self.camelize( string )
string.split( /[^a-z0-9]/i ).map{ |w| w.capitalize }.join
end
|
.underscore(string) ⇒ Object
14
15
16
|
# File 'lib/constant_contact/base_resource.rb', line 14
def self.underscore( string )
string.to_s.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').tr("-", "_").downcase
end
|