module Bronze::Entities::PrimaryKey

Module for defining a primary key attribute on an entity class.

Public Instance Methods

primary_key() click to toggle source

@return [Object] the primary key for the current entity.

# File lib/bronze/entities/primary_key.rb, line 62
def primary_key
  attribute_name = self.class.primary_key&.name

  return nil unless attribute_name

  get_attribute(attribute_name)
end