module ApiUtils

Public Class Methods

camelize_with_space(str) click to toggle source
# File lib/api_utils.rb, line 5
def self.camelize_with_space(str)
  str.split('_').map {|w| w.capitalize}.join(' ')
end
string_to_method_name(s) click to toggle source
# File lib/api_utils.rb, line 9
def self.string_to_method_name(s)
  s.gsub(' ', '_').downcase
end
string_to_symbol(s) click to toggle source
# File lib/api_utils.rb, line 13
def self.string_to_symbol(s)
  s.gsub!(/[()%]*/, '')
  s.gsub(' ', '_').downcase.to_sym
end
symbol_to_string(sym) click to toggle source
# File lib/api_utils.rb, line 18
def self.symbol_to_string(sym)
  sym.class == Symbol ? self.camelize_with_space(sym.to_s) : self.camelize_with_space(sym)
end