Module: ActiveSupport::Inflector

Defined in:
lib/redis_backed_model/inflections.rb

Instance Method Summary collapse

Instance Method Details

#deinstance_variableize(the_string) ⇒ Object

Downcases and removes a leading @



4
5
6
7
# File 'lib/redis_backed_model/inflections.rb', line 4

def deinstance_variableize(the_string)
  result = the_string.to_s.dup
  result.downcase.gsub(/^@/, '')
end

#instance_variableize(the_string) ⇒ Object

Adds a @ to the beginning of the_string and returns it as a symbol



10
11
12
# File 'lib/redis_backed_model/inflections.rb', line 10

def instance_variableize(the_string)
  "@#{the_string}".to_sym
end