Class: RMBuilderComputedApi

RMBuilderComputedApi

new RMBuilderComputedApi()

Builder DSL extension to build computed properties.

A computed property is a "virtual" property which is created using other model properties. For example, a user has a firstName and lastName, A computed property, fullName, is generated from the two.

Adds the following property modifiers: * computed function will be assigned as getter to Model, maps to RMBuilderComputedApi#attrAsComputed

Source:
  • module/extended/builder-computed.js, line 5

Methods

attrAsComputed(_attr, _fn) → {BuilderApi}

Registers a model computed property

Parameters:
Name Type Description
_attr string

Attribute name

_fn function

Function that returns the desired attribute value when run.

Source:
  • module/extended/builder-computed.js, line 31
Returns:

self

Type
BuilderApi