This package has been deprecated

Author message:

no longer maintaining

eden-model

0.0.33 • Public • Published

Model

DESCRIPTION

Build Status

General

Installation

npm install eden-model

Usage

var model = require('eden-model');

Methods


set

 object set({ name: 'chris', age: 32 });

Set the raw data hash

Parameters

  1. chris - object (string | character | integer | date) to be set

Returns

object

Example

Code
model({ name: 'chris', age: 32 }).setAge(45).getAge();
Outputs
45

get

 object get('john');

Return a copy of the raw data hash

Parameters

  1. 'john' - object (string | character | integer | date) to get

Returns

object

Example

Code
    var user = model({ name: 'chris', age: 32 });
    user.name = 'john';

user.getName();
Outputs
'john'

copy

 Eden_Model copy(name, nickname);

Copies a value of source key to destination key.

Parameters

  1. name - string (to copy)

  2. nickname - string (copy value from name)

Returns

Eden_Model

Example

Code
    var user = model({ name : 'chris', age : 32 }).copy('name', 'nickname');

user.nickname;
Outputs
'chris'

Readme

Keywords

Package Sidebar

Install

npm i eden-model

Weekly Downloads

4

Version

0.0.33

License

none

Last publish

Collaborators

  • archive_donotuse