module Jennifer::Presentable
Overview
This is an abstract interface
Direct including types
Defined in:
jennifer/model/presentable.crInstance Method Summary
-
#attribute(name : String | Symbol, raise_exception : Bool = true)
Returns value by attribute name or raises
Jennifer::BaseException
if none. -
#attribute_metadata(name : String | Symbol)
Returns field name metadata or raises
ArgumentError
. -
#class_name : String
Returns underscored model class name.
-
#errors : Jennifer::Model::Errors
Returns container with object's validation errors.
-
#human_attribute_name(name : String | Symbol)
Returns human readable attribute name based on translations.
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"
abstract
def attribute_metadata(name : String | Symbol)
#
Returns field name metadata or raises ArgumentError
.
abstract
def class_name : String
#
Returns underscored model class name.
Admin::User.all.last.class_name # => "admin_user"
abstract
def human_attribute_name(name : String | Symbol)
#
Returns human readable attribute name based on translations.