Stannum

A library for defining and validating data structures.

Class: Stannum::Associations::Many

Parent Namespace
Stannum::Associations
Inherited Classes
Stannum::Association > Object
Defined In
lib/stannum/associations/many.rb

Table Of Contents

Overview

Data object representing a plural association.

Back To Top

Defined Under Namespace

Classes
Proxy

Back To Top

Constructor

#initialize(name:, options:, type:) => Association

Inherited From
Stannum::Association

Parameters

Returns

Back To Top

Instance Attributes

#name => String (readonly)

Inherited From
Stannum::Association

Returns

#options => Hash (readonly)

Inherited From
Stannum::Association

Returns

#type => String (readonly)

Inherited From
Stannum::Association

Returns

Back To Top

Instance Methods

#add_value(entity, value, update_inverse: true) => void

Adds the given value to the association for the entity.

Parameters

Returns

#clear_value(entity, update_inverse: true) => void

Removes the value of the association for the entity.

Parameters

Returns

#entity_class_name => String, nil

Inherited From
Stannum::Association

Returns

#foreign_key? => true, false

Inherited From
Stannum::Association

Returns

#foreign_key_name => String?

Inherited From
Stannum::Association

Returns

#foreign_key_type => Class, Stannum::Constraint, nil

Inherited From
Stannum::Association

Returns

#get_value(entity) => Object

Retrieves the value of the association for the entity.

Parameters

Returns

#inverse? => Boolean

Inherited From
Stannum::Association

Returns

#inverse_name => String

Inherited From
Stannum::Association

Returns

#many? => true

Returns

#one? => false

Inherited From
Stannum::Association

Returns

#reader_name => Symbol

Inherited From
Stannum::Association

Returns

#remove_value(entity, value, update_inverse: true) => void

Removes the given value from the association for the entity.

Parameters

Returns

#resolved_inverse => Stannum::Association

Returns

Raises

#resolved_type => Module

Inherited From
Stannum::Association

Returns

#set_value(entity, value, update_inverse: true) => void

Replaces the association for the entity with the given value.

Parameters

Returns

#writer_name => Symbol

Inherited From
Stannum::Association

Returns

Back To Top


Back to Documentation | Reference | Stannum | Stannum::Associations