#

API Docs for: v3.16.0-alpha.2
Show: Inherited Protected Private Deprecated

# InspectorDataAdapter Class

Extends DataAdapter
Defined in: `../debug/addon/index.js:36`
Module: @ember-data/debug

Implements `@ember/debug/data-adapter` with for EmberData integration with the ember-inspector.

- Index
- Methods

## Item Index

### Methods

- columnNameToDesc
- columnsForType
- getFilters
- getRecordColor
- getRecordColumnValues
- getRecordFilterValues
- getRecordKeywords
- getRecords
- observeRecord
- watchModelTypes

## Methods

### `columnNameToDesc`

(

- `name`

)
String private

Defined in `../debug/addon/index.js:135`

Creates a human readable string used for column headers

#### Parameters:

- `name` String

  The attribute name

#### Returns:

String:

Human readable string based on the attribute name

### `columnsForType`

(

- `typeClass`

)
Array private

Defined in `../debug/addon/index.js:151`

Get the columns for a given model type

#### Parameters:

- `typeClass` Model

#### Returns:

Array:

An array of columns of the following format: name: {String} The name of the column desc: {String} Humanized description (what would show in a table column name)

### `getFilters`

() Array private

Defined in `../debug/addon/index.js:47`

Specifies how records can be filtered based on the state of the record Records returned will need to have a `filterValues` property with a key for every name in the returned array

#### Returns:

Array:

List of objects defining filters The object should have a `name` and `desc` property

### `getRecordColor`

(

- `record`

)
String private

Defined in `../debug/addon/index.js:261`

Returns a color that represents the record's state Possible colors: black, blue, green

#### Parameters:

- `record` Model

#### Returns:

String:

The record color

### `getRecordColumnValues`

(

- `record`

)
Object private

Defined in `../debug/addon/index.js:206`

Gets the values for each column This is the attribute values for a given record

#### Parameters:

- `record` Model

  to get values from

#### Returns:

Object:

Keys should match column names defined by the model type

### `getRecordFilterValues`

(

- `record`

)
Object private

Defined in `../debug/addon/index.js:244`

Returns the values of filters defined by `getFilters` These reflect the state of the record

#### Parameters:

- `record` Model

#### Returns:

Object:

The record state filter values

### `getRecordKeywords`

(

- `record`

)
Array private

Defined in `../debug/addon/index.js:228`

Returns keywords to match when searching records

#### Parameters:

- `record` Model

#### Returns:

Array:

Relevant keywords for search based on the record's attribute values

### `getRecords`

(

- `modelClass`
- `modelName`

)
Array

Defined in `../debug/addon/index.js:180`

Fetches all loaded records for a given type

#### Parameters:

- `modelClass` Model

  of the record

- `modelName` String

  of the record

#### Returns:

Array:

An array of Model records This array will be observed for changes, so it should update when new records are added/removed

### `observeRecord`

(

- `record`
- `recordUpdated`

)
Function

Defined in `../debug/addon/index.js:280`

Observes all relevant properties and re-sends the wrapped record when a change occurs

#### Parameters:

- `record` Model
- `recordUpdated` Function

  Callback used to notify changes

#### Returns:

Function:

The function to call to remove all observers

### `watchModelTypes`

(

- `typesAdded`
- `typesUpdated`

)
Function public

Defined in `../debug/addon/index.js:69`

Fetch the model types and observe them for changes. Maintains the list of model types without needing the Model package for detection.

#### Parameters:

- `typesAdded` Function

  Callback to call to add types. Takes an array of objects containing wrapped types (returned from `wrapModelType`).

- `typesUpdated` Function

  Callback to call when a type has changed. Takes an array of objects containing wrapped types.

#### Returns:

Function:

Method to call to remove all observers