Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/ms_translate.rb
Overview
Wrapper for Microsoft Translator V2
Instance Method Summary collapse
-
#camelize(first_letter = :upper) ⇒ Object
(also: #camelcase)
By default,
camelize
converts strings to UpperCamelCase.
Instance Method Details
#camelize(first_letter = :upper) ⇒ Object Also known as: camelcase
By default, camelize
converts strings to UpperCamelCase. If the argument to camelize is set to :lower
then camelize produces lowerCamelCase.
camelize
will also convert ‘/’ to ‘::’ which is useful for converting paths to namespaces.
"active_record".camelize # => "ActiveRecord"
"active_record".camelize(:lower) # => "activeRecord"
"active_record/errors".camelize # => "ActiveRecord::Errors"
"active_record/errors".camelize(:lower) # => "activeRecord::Errors"
24 25 26 27 28 29 |
# File 'lib/ms_translate.rb', line 24 def camelize(first_letter = :upper) case first_letter when :upper then ActiveSupport::Inflector.camelize(self, true) when :lower then ActiveSupport::Inflector.camelize(self, false) end end |