Sha256: be1c2ba6726e21f1788167ae8d044a7ae9600e240a1636b1453ec5405f7b6550

Contents?: true

Size: 260 Bytes

Versions: 1

Compression:

Stored size: 260 Bytes

Contents

module Plaza
  module Inflector
    extend self

    def singularize(str)
      str.strip!
      str.gsub!(/ies$/,'y')
      str.chomp('s')
    end

    def classify(table_name)
      singularize(table_name.split('_').map(&:capitalize).join)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
plaza-0.0.4 lib/plaza/inflector.rb