Sha256: a157659c684f3f9622ed5f38935929b5deeedaeb7036efec8fb73a84e671eed7

Contents?: true

Size: 810 Bytes

Versions: 1

Compression:

Stored size: 810 Bytes

Contents

require 'verbs'

module Resonance
  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
resonance-0.3.2 lib/resonance/supports/converter.rb