Stannum

A library for defining and validating data structures.

Class: Stannum::Associations::Many::Proxy

Parent Namespace
Stannum::Associations::Many
Included Modules
Enumerable
Defined In
lib/stannum/associations/many.rb

Table Of Contents

Overview

Wrapper object for an entity’s plural association.

Back To Top

Constructor

#initialize(association:, entity:) => Proxy

Parameters

Returns

Back To Top

Instance Methods

#==(other) => true, false

Parameters

Returns

#add(value) => self

Also known as: <<, push

Appends the entity to the association.

If the entity is already in the association data, this method does nothing.

Parameters

Returns

#each => Enumerator
#each(&block) => Object

Overloads

#each => Enumerator
Returns
  • (Enumerator) — an enumerator over each item in the entity's association data.
#each(&block) => Object
Yields
  • Yields each item in the entity’s association data.
Yield Parameters

#inspect => String

Returns

#remove(value) => self

Also known as: delete

Removes the entity from the association.

If the entity is not in the association data, this method does nothing.

Parameters

Returns

Back To Top


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