<commit_before># Ember RESTless

RESTless is a lightweight data persistence library for Ember.js.

It is used to communicate with a remote persistence layer (such as a JSON API) and map that data between your client side JavaScript Ember application.

Its goal is to reproduce much of the simple, useful features of [ember-data](https://github.com/emberjs/data), with a similar API, while remaining lightweight and stable.  Transitioning between the two should be possible with minimal effort.  The main departure from ember-data is the idea of the 'Store'. Instead, all transactions are executed immediately.  This can help alleviate bugs found in regards to syncing the Store with the backend service.

## Getting started

Include ember-restless.js from the dist/ folder in your application

### Namespace

RESTless can be referenced either with the namespace **RESTless** or the shorthand **RL**.  Similar to **Ember** and **Em**.

### Defining a Client

Similar to defining the 'Store' using ember-data, instead define the REST 'Client' for your application.  RESTless will automatically detect the RESTClient on your application namespace.  Defining a client is currently optional, and only needed if you would like to provide a custom adapter.

``` javascript
App.RESTClient = RL.RESTClient.create({
  revision: 1,
  adapter: App.RESTAdapter
});
```

### Defining a custom Adapter

Create a custom adapter to set a url to your backend REST service and optionally the namespace.
For example, if your REST API is located at http://api.myservice.com/v1
``` javascript
App.RESTAdapter = RL.RESTAdapter.create({
  url: 'http://api.myservice.com',
  namespace: 'v1'
});
```
See the **Advanced** section below for further use of a custom adapter.

### Defining Models

Each model you create should extend RL.Model
``` javascript
App.Person = RL.Model.extend();
```

### Attributes

Supported types are string, number, boolean, and date.  With a custom adapter, you can register custom types and transformations.
``` javascript
App.Person = RL.Model.extend({
  firstName: RL.attr('string'),
  lastName: RL.attr('string'),
  birthday: RL.attr('date'),
  createdAt: RL.attr('date', readOnly: true); // read-only attributes won't get sent back up to the API.
});
```

### Relationships

One-to-one use the _belongsTo_ attribute helper

``` javascript
App.User = RL.Model.extend({
  profile: RL.belongsTo('App.Profile')
});<commit_msg>fix typo in readme<commit_after># Ember RESTless

RESTless is a lightweight data persistence library for Ember.js.

It is used to communicate with a remote persistence layer (such as a JSON API) and map that data between your client side JavaScript Ember application.

Its goal is to reproduce much of the simple, useful features of [ember-data](https://github.com/emberjs/data), with a similar API, while remaining lightweight and stable.  Transitioning between the two should be possible with minimal effort.  The main departure from ember-data is the idea of the 'Store'. Instead, all transactions are executed immediately.  This can help alleviate bugs found in regards to syncing the Store with the backend service.

## Getting started

Include ember-restless.js from the dist/ folder in your application

### Namespace

RESTless can be referenced either with the namespace **RESTless** or the shorthand **RL**.  Similar to **Ember** and **Em**.

### Defining a Client

Similar to defining the 'Store' using ember-data, instead define the REST 'Client' for your application.  RESTless will automatically detect the RESTClient on your application namespace.  Defining a client is currently optional, and only needed if you would like to provide a custom adapter.

``` javascript
App.RESTClient = RL.RESTClient.create({
  revision: 1,
  adapter: App.RESTAdapter
});
```

### Defining a custom Adapter

Create a custom adapter to set a url to your backend REST service and optionally the namespace.
For example, if your REST API is located at http://api.myservice.com/v1
``` javascript
App.RESTAdapter = RL.RESTAdapter.create({
  url: 'http://api.myservice.com',
  namespace: 'v1'
});
```
See the **Advanced** section below for further use of a custom adapter.

### Defining Models

Each model you create should extend RL.Model
``` javascript
App.Person = RL.Model.extend();
```

### Attributes

Supported types are string, number, boolean, and date.  With a custom adapter, you can register custom types and transformations.
``` javascript
App.Person = RL.Model.extend({
  firstName: RL.attr('string'),
  lastName: RL.attr('string'),
  birthday: RL.attr('date'),
  createdAt: RL.attr('date', { readOnly: true }); // read-only attributes won't get sent back up to the API.
});
```

### Relationships

One-to-one use the _belongsTo_ attribute helper

``` javascript
App.User = RL.Model.extend({
  profile: RL.belongsTo('App.Profile')
});
{'fraction_non_alphanumeric': 0.09615779741113623, 'fraction_numerical': 0.0012327922745017466, 'mean_word_length': 4.519274376417234, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4681066', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1276, 'n_words': 609}