Sha256: ee8bfbda35da40a67c2c49d64ff8a60abae1ed66ae3181d6aa884f04b6b5b054

Contents?: true

Size: 809 Bytes

Versions: 1

Compression:

Stored size: 809 Bytes

Contents

require 'verbs'

module Resonate
  module Supports
    module Converter
      private

      def classify(str)
        str.capitalize.constantize
      end

      def pluralize(str)
        str.pluralize
      end

      def progressize(str)
        if patches['progressize'].key?(str)
          return patches['progressize'][str]
        end

        str.verb.conjugate(aspect: :progressive).split(' ').last
      end

      def peoplize(str)
        str = (str.last == 'e') ? str.chop : str
        str + 'ers'
      end

      def pastize(str)
        str.verb.conjugate(tense: :past).split(' ').last
      end

      def patches
        @patches ||= YAML.load_file(patches_path)['patches']
      end

      def patches_path
        File.expand_path('../patches.yml', __FILE__)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
resonate-0.3.1 lib/resonate/supports/converter.rb