module Resonate::Supports::Converter

Private Instance Methods

classify(str) click to toggle source
# File lib/resonate/supports/converter.rb, line 8
def classify(str)
  str.capitalize.constantize
end
pastize(str) click to toggle source
# File lib/resonate/supports/converter.rb, line 29
def pastize(str)
  str.verb.conjugate(tense: :past).split(' ').last
end
patches() click to toggle source
# File lib/resonate/supports/converter.rb, line 33
def patches
  @patches ||= YAML.load_file(patches_path)['patches']
end
patches_path() click to toggle source
# File lib/resonate/supports/converter.rb, line 37
def patches_path
  File.expand_path('../patches.yml', __FILE__)
end
peoplize(str) click to toggle source
# File lib/resonate/supports/converter.rb, line 24
def peoplize(str)
  str = (str.last == 'e') ? str.chop : str
  str + 'ers'
end
pluralize(str) click to toggle source
# File lib/resonate/supports/converter.rb, line 12
def pluralize(str)
  str.pluralize
end
progressize(str) click to toggle source
# File lib/resonate/supports/converter.rb, line 16
def progressize(str)
  if patches['progressize'].key?(str)
    return patches['progressize'][str]
  end

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