Sha256: 4edc79b43b018f324f7182fe6baf0cdaa3603f9fd72a09b97f625638fc46e7ca

Contents?: true

Size: 919 Bytes

Versions: 25

Compression:

Stored size: 919 Bytes

Contents

Data
===

Everytime you interact with back-end data you will get an instance of LHS::Data.

```ruby
Service.where #<LHS::Data @_proxy=#<LHS::Collection>>
Service.find(123) #<LHS::Data @_proxy=#<LHS::Item>>
```

## Internals
** You shold not use LHS internals as consumer. 
The following explanations are for developing LHS itself! **

```ruby
data = Service.where(entry_id: 123)

# Proxy that is used to access the data
data._proxy #<LHS::Collection>

# Raw data that is underlying
data._raw #<Hash>

# The parent
data.first._proxy #<LHS::Item>
data.first._parent._proxy #<LHS::Collection>
data.first._parent === data

# The root
data.first.some_relation.first._proxy #<LHS::Item>
data.first._root._proxy #<LHS::Collection>
data.first.some_relation.first._root === data

# Service that was used to fetch the data
data._service #<Service>

# The request that was used to fetch the data
data._request #<LHC::Request>
```

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
lhs-2.2.2 docs/data.md
lhs-1.6.1 docs/data.md
lhs-2.2.1 docs/data.md
lhs-2.2.0 docs/data.md
lhs-1.6.0 docs/data.md
lhs-2.1.1 docs/data.md
lhs-2.1.0 docs/data.md
lhs-2.0.5 docs/data.md
lhs-2.0.4 docs/data.md
lhs-2.0.3 docs/data.md
lhs-2.0.2 docs/data.md
lhs-2.0.1 docs/data.md
lhs-2.0.0 docs/data.md
lhs-1.5.0 docs/data.md
lhs-1.4.0 docs/data.md
lhs-1.3.1 docs/data.md
lhs-1.3.0 docs/data.md
lhs-1.2.3 docs/data.md
lhs-1.2.2 docs/data.md
lhs-1.2.1 docs/data.md