class String

some helpers for some dirty work

some helpers for some dirty work

some helpers for some dirty work

Public Instance Methods

fix_convention_exceptions() click to toggle source
# File lib/fog/softlayer/ext/string.rb, line 7
def fix_convention_exceptions
  # SLAPI WHY U No Follow Own Convention!?
  self.gsub!(/ipaddress/i, 'IpAddress')
  self.gsub!(/loadbalancer/i, 'LoadBalancer')
end
softlayer_camelize() click to toggle source
# File lib/fog/softlayer/compute.rb, line 154
def softlayer_camelize
  self.split('_').inject([]){ |buffer,e| buffer.push(buffer.empty? ? e : e.capitalize) }.join
end
softlayer_underscore() click to toggle source
# File lib/fog/softlayer/compute.rb, line 158
def softlayer_underscore
  self.gsub(/::/, '/').
      gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
      gsub(/([a-z\d])([A-Z])/,'\1_\2').
      tr("-", "_").
      downcase
end