Skip to content

Documentation


Documentation / @blazetrails/activemodel / LazyAttributeSet

Class: LazyAttributeSet ​

Defined in: packages/activemodel/lib/attribute-set/builder.ts:42

Extends ​

Constructors ​

Constructor ​

new LazyAttributeSet(values, types, additionalTypes, defaultAttributes, attributes?): LazyAttributeSet

Defined in: packages/activemodel/lib/attribute-set/builder.ts:51

Parameters ​

ParameterType
valuesRbHash<unknown>
typesRbHash<ValueType<unknown>>
additionalTypesRbHash<ValueType<unknown>>
defaultAttributesRbHash<Attribute>
attributesRbHash<Attribute>

Returns ​

LazyAttributeSet

Overrides ​

AttributeSet.constructor

Properties ​

_attributes ​

protected _attributes: RbHash<Attribute>

Defined in: packages/activemodel/lib/attribute-set/builder.ts:43

Overrides ​

AttributeSet._attributes

Methods ​

accessed() ​

accessed(): string[]

Defined in: packages/activemodel/lib/attribute-set.ts:122

Returns ​

string[]

Inherited from ​

AttributeSet.accessed


attributes() ​

protected attributes(): RbHash<Attribute>

Defined in: packages/activemodel/lib/attribute-set/builder.ts:119

Returns ​

RbHash<Attribute>

Overrides ​

AttributeSet.attributes


castTypes() ​

castTypes(): Record<string, ValueType<unknown> | null> | Hash<string, ValueType<unknown> | null>

Defined in: packages/activemodel/lib/attribute-set.ts:54

Returns ​

Record<string, ValueType<unknown> | null> | Hash<string, ValueType<unknown> | null>

Inherited from ​

AttributeSet.castTypes


deepDup() ​

deepDup(): AttributeSet

Defined in: packages/activemodel/lib/attribute-set.ts:104

Returns ​

AttributeSet

Inherited from ​

AttributeSet.deepDup


eachValue() ​

eachValue(fn): void

Defined in: packages/activemodel/lib/attribute-set.ts:27

Parameters ​

ParameterType
fn(attr) => void

Returns ​

void

Inherited from ​

AttributeSet.eachValue


equals() ​

equals(other): boolean

Defined in: packages/activemodel/lib/attribute-set.ts:135

Parameters ​

ParameterType
otherunknown

Returns ​

boolean

Inherited from ​

AttributeSet.equals


except() ​

except(...names): Record<string, Attribute> | Hash<string, Attribute>

Defined in: packages/activemodel/lib/attribute-set.ts:35

Parameters ​

ParameterType
...namesstring[]

Returns ​

Record<string, Attribute> | Hash<string, Attribute>

Inherited from ​

AttributeSet.except


fetch() ​

fetch<T>(name, ...rest): Attribute | T

Defined in: packages/activemodel/lib/attribute-set.ts:31

Type Parameters ​

Type ParameterDefault type
TAttribute

Parameters ​

ParameterType
namestring
...rest[] | [T | Block<T>]

Returns ​

Attribute | T

Inherited from ​

AttributeSet.fetch


fetchValue() ​

fetchValue(name, block?): unknown

Defined in: packages/activemodel/lib/attribute-set/builder.ts:88

Parameters ​

ParameterType
namestring
block?(name) => unknown

Returns ​

unknown

Invented Arm ​

if — PERMANENT

Invented Arm ​

hasKey — PERMANENT

Perf ​

26% — PERMANENT

Overrides ​

AttributeSet.fetchValue


freeze() ​

freeze(): this

Defined in: packages/activemodel/lib/attribute-set.ts:98

Returns ​

this

Inherited from ​

AttributeSet.freeze


getAttribute() ​

getAttribute(name): Attribute

Defined in: packages/activemodel/lib/attribute-set.ts:43

Parameters ​

ParameterType
namestring

Returns ​

Attribute

Inherited from ​

AttributeSet.getAttribute


initializeClone() ​

initializeClone(_): void

Defined in: packages/activemodel/lib/attribute-set.ts:112

Parameters ​

ParameterType
_AttributeSet

Returns ​

void

Inherited from ​

AttributeSet.initializeClone


initializeDup() ​

initializeDup(_): void

Defined in: packages/activemodel/lib/attribute-set.ts:108

Parameters ​

ParameterType
_AttributeSet

Returns ​

void

Inherited from ​

AttributeSet.initializeDup


isInclude() ​

isInclude(name): boolean

Defined in: packages/activemodel/lib/attribute-set.ts:70

Parameters ​

ParameterType
namestring

Returns ​

boolean

Inherited from ​

AttributeSet.isInclude


isKey() ​

isKey(name): boolean

Defined in: packages/activemodel/lib/attribute-set/builder.ts:67

Parameters ​

ParameterType
namestring

Returns ​

boolean

Overrides ​

AttributeSet.isKey


keys() ​

keys(): string[]

Defined in: packages/activemodel/lib/attribute-set/builder.ts:74

Returns ​

string[]

Overrides ​

AttributeSet.keys


map() ​

map(fn): AttributeSet

Defined in: packages/activemodel/lib/attribute-set.ts:126

Parameters ​

ParameterType
fn(attr) => Attribute

Returns ​

AttributeSet

Inherited from ​

AttributeSet.map


reset() ​

reset(key): void

Defined in: packages/activemodel/lib/attribute-set.ts:116

Parameters ​

ParameterType
keystring

Returns ​

void

Inherited from ​

AttributeSet.reset


reverseMergeBang() ​

reverseMergeBang(targetAttributes): this

Defined in: packages/activemodel/lib/attribute-set.ts:131

Parameters ​

ParameterType
targetAttributesAttributeSet

Returns ​

this

Inherited from ​

AttributeSet.reverseMergeBang


set() ​

set(name, value): void

Defined in: packages/activemodel/lib/attribute-set.ts:50

Parameters ​

ParameterType
namestring
valueAttribute

Returns ​

void

Inherited from ​

AttributeSet.set


toH() ​

toH(): Record<string, unknown>

Defined in: packages/activemodel/lib/attribute-set.ts:152

Returns ​

Record<string, unknown>

Inherited from ​

AttributeSet.toH


toHash() ​

toHash(): Record<string, unknown>

Defined in: packages/activemodel/lib/attribute-set.ts:148

Returns ​

Record<string, unknown>

Inherited from ​

AttributeSet.toHash


valuesBeforeTypeCast() ​

valuesBeforeTypeCast(): Record<string, unknown> | Hash<string, unknown>

Defined in: packages/activemodel/lib/attribute-set.ts:58

Returns ​

Record<string, unknown> | Hash<string, unknown>

Inherited from ​

AttributeSet.valuesBeforeTypeCast


valuesForDatabase() ​

valuesForDatabase(): Record<string, unknown> | Hash<string, unknown>

Defined in: packages/activemodel/lib/attribute-set.ts:62

Returns ​

Record<string, unknown> | Hash<string, unknown>

Inherited from ​

AttributeSet.valuesForDatabase


writeCastValue() ​

writeCastValue(name, value): Attribute

Defined in: packages/activemodel/lib/attribute-set.ts:94

Parameters ​

ParameterType
namestring
valueunknown

Returns ​

Attribute

Inherited from ​

AttributeSet.writeCastValue


writeFromDatabase() ​

writeFromDatabase(name, value): void

Defined in: packages/activemodel/lib/attribute-set.ts:82

Parameters ​

ParameterType
namestring
valueunknown

Returns ​

void

Inherited from ​

AttributeSet.writeFromDatabase


writeFromUser() ​

writeFromUser(name, value): unknown

Defined in: packages/activemodel/lib/attribute-set.ts:86

Parameters ​

ParameterType
namestring
valueunknown

Returns ​

unknown

Inherited from ​

AttributeSet.writeFromUser