0.0.33 • Published 9 years ago

eden-model v0.0.33

Weekly downloads
67
License
-
Repository
github
Last release
9 years ago

#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'
0.0.33

9 years ago

0.0.32

9 years ago

0.0.31

9 years ago

0.0.30

9 years ago

0.0.28

10 years ago

0.0.27

10 years ago

0.0.26

10 years ago

0.0.25

10 years ago

0.0.24

10 years ago

0.0.23

10 years ago

0.0.21

10 years ago

0.0.20

10 years ago

0.0.17

10 years ago

0.0.16

10 years ago

0.0.15

10 years ago

0.0.14

10 years ago

0.0.12

10 years ago

0.0.10

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago