Class: Hanami::Model::RelationName Private

Inherits:
EntityName show all
Defined in:
lib/hanami/model/relation_name.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Conventional name for relations.

Given a repository named SourceFileRepository, the associated relation will be :source_files.

Since:

  • 0.7.0

Constant Summary

Constants inherited from EntityName

EntityName::SUFFIX

Class Method Summary collapse

Methods inherited from EntityName

#initialize, #to_s, #underscore

Constructor Details

This class inherits a constructor from Hanami::Model::EntityName

Class Method Details

.new(name) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the relation name.

Parameters:

  • name (Class, String)

    the class or its name

Returns:

  • (String)

    the relation name

Since:

  • 0.7.0



19
20
21
# File 'lib/hanami/model/relation_name.rb', line 19

def self.new(name)
  Utils::String.transform(super, :underscore, :pluralize)
end