yajsapi / Exports / props/com / ComLinear
props/com.ComLinear
Com
↳ ComLinear
scheme
new ComLinear(): ComLinear
Returns: ComLinear
Inherited from: Com
Defined in: yajsapi/props/base.ts:108
• fixed_price: number
Defined in: yajsapi/props/com.ts:31
• price_for: Object
Defined in: yajsapi/props/com.ts:32
• price_model: Field
Inherited from: Com.price_model
Defined in: yajsapi/props/com.ts:27
• scheme: Field
Defined in: yajsapi/props/com.ts:26
▸ _custom_mapping(props
: any, data
: any): void
Parameters:
Name | Type |
| any |
| any |
Returns: void
Overrides: Com
Defined in: yajsapi/props/com.ts:34
▸ fields(cls
: any): Field[]
Parameters:
Name | Type |
| any |
Returns: Field[]
Inherited from: Com
Defined in: yajsapi/props/base.ts:113
▸ from_properties(props
: object): any
Initialize the model from an object representation.
description
When provided with an object of properties, it will find the matching keys within it and fill the model fields with the values from the object.
It ignores non-matching keys - i.e. doesn't require filtering of the properties' object before the model is fed with the data. Thus, several models can be initialized from the same object and all models will only load their own data.
Parameters:
Name | Type | Description |
| object | |
Returns: any
Inherited from: Com
Defined in: yajsapi/props/base.ts:137
▸ keys(): any
example
import { props } from "yajsapi"const { Field, Model } = props;export class NodeInfo extends Model {name: Field = new Field({ metadata: { key: "golem.node.id.name" } });subnet_tag: Field = new Field({metadata: { key: "golem.node.debug.subnet" },});}new NodeInfo().keys().name()// Output: 'golem.node.id.name'
Returns: any
a mapping between the model's field names and the property keys
Inherited from: Com
Defined in: yajsapi/props/base.ts:182