Class Inflector::Inflections
In: lib/core_ex.rb
Parent: Object

Methods

Attributes

camelize_rules  [R]  <<<
underscore_rules  [R]  <<<

Public Class methods

>>>

[Source]

# File lib/core_ex.rb, line 132
        def initialize
          # <<<
          clear_all
          # >>>
        end

Public Instance methods

[Source]

# File lib/core_ex.rb, line 164
        def camelize(rule, replacement)
          @camelize_rules.unshift [mk_regexp(rule), replacement]
        end

>>>

[Source]

# File lib/core_ex.rb, line 142
        def clear ( scope=:all )
          case scope
            when :all
              # <<<
              clear_all
              # >>>
            else
              instance_variable_set "@#{scope}", []
          end
        end

<<<

[Source]

# File lib/core_ex.rb, line 138
        def clear_all
          @plurals, @singulars, @uncountables, @underscore_rules, @camelize_rules = [], [], [], [], []
        end

[Source]

# File lib/core_ex.rb, line 167
        def fixed_case ( camel_cased_word,
                         lower_case_and_underscored_word=camel_cased_word.downcase )
          camelize(lower_case_and_underscored_word, camel_cased_word)
          underscore(camel_cased_word, lower_case_and_underscored_word)
        end

[Source]

# File lib/core_ex.rb, line 172
        def fixed_cases ( *words )
          for word in words
            if word.is_a? Array
              fixed_case(*word)
            else
              fixed_case word
            end
          end
        end

[Source]

# File lib/core_ex.rb, line 161
        def underscore(rule, replacement)
          @underscore_rules.unshift [mk_regexp(rule), replacement]
        end

[Validate]