Sha256: 7643344b8ee86890c448fa59c9ec6bd2da8e0d33d570c6a1ef760a6acb515b10

Contents?: true

Size: 431 Bytes

Versions: 1

Compression:

Stored size: 431 Bytes

Contents

module ActiveSupport
  module Inflector
    class Inflections
      attr_reader :gerunds

      def gerunds
        @gerunds ||= []
      end

    end
    
    def gerundize(word)
      result = word.to_s.dup
      if word.empty?
        result
      else
        inflections.gerunds.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }
        result == word ? word + 'ing' : result
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
inflectious-0.1.0 lib/inflectious.rb