module Jennifer::Presentable

Overview

This is an abstract interface

Direct including types

Defined in:

jennifer/model/presentable.cr

Instance Method Summary

Instance Method Detail

abstract def attribute(name : String | Symbol, raise_exception : Bool = true) #

Returns value by attribute name or raises Jennifer::BaseException if none.

User.all.last.attribute(:email) # => "test@example.com"

[View source]
abstract def attribute_metadata(name : String | Symbol) #

Returns field name metadata or raises ArgumentError.


[View source]
abstract def class_name : String #

Returns underscored model class name.

Admin::User.all.last.class_name # => "admin_user"

[View source]
abstract def errors : Jennifer::Model::Errors #

Returns container with object's validation errors.


[View source]
abstract def human_attribute_name(name : String | Symbol) #

Returns human readable attribute name based on translations.


[View source]