Sha256: c06d4288fc1760b25ef5bbca2042626959a4dd537e9fe2e5098d3e7c95177bee
Contents?: true
Size: 307 Bytes
Versions: 3
Compression:
Stored size: 307 Bytes
Contents
module Tiddle class ModelName def with_underscores(model) colon_to_underscore(model).underscore.upcase end def with_dashes(model) with_underscores(model).dasherize end private def colon_to_underscore(model) model.model_name.to_s.tr(':', '_') end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
tiddle-1.8.1 | lib/tiddle/model_name.rb |
tiddle-1.8.0 | lib/tiddle/model_name.rb |
tiddle-1.7.1 | lib/tiddle/model_name.rb |