Class: CreditGateway::CamelizerUpper

Inherits:
Object
  • Object
show all
Defined in:
lib/credit_gateway/camelizer_upper.rb

Class Method Summary collapse

Class Method Details

.transform(underscore_string) ⇒ Object

Converts this_is_my_string to ThisIsMyString and returns it as a symbol.



6
7
8
9
10
11
12
# File 'lib/credit_gateway/camelizer_upper.rb', line 6

def self.transform(underscore_string)
  underscore_string.to_s
                   .split('_')
                   .map(&:capitalize)
                   .join
                   .to_sym
end