Sha256: 563cc571a742e1dac338174629f16d4b6b155e51e11b1a5ab558990796935e4e
Contents?: true
Size: 773 Bytes
Versions: 12
Compression:
Stored size: 773 Bytes
Contents
module Hanami module Model # Conventional name for entities. # # Given a repository named <tt>SourceFileRepository</tt>, the associated # entity will be <tt>SourceFile</tt>. # # @since 0.7.0 # @api private class EntityName # @since 0.7.0 # @api private SUFFIX = /Repository\z/ # @param name [Class,String] the class or its name # @return [String] the entity name # # @since 0.7.0 # @api private def initialize(name) @name = name.sub(SUFFIX, '') end # @since 0.7.0 # @api private def underscore Utils::String.underscore(@name).to_sym end # @since 0.7.0 # @api private def to_s @name end end end end
Version data entries
12 entries across 12 versions & 1 rubygems