<commit_before># Daylight Users Guide

Daylight is extensions built on top of
[ActiveResource](https://github.com/rails/activeresource).
Everything you can do with `ActiveResource` is available to you in Daylight.

Once you have an API [developed](develop.md) with Daylight, you will want to be
able to use it.  As an end-user of an API, it may be distributed to you in a
gem (or other means) and you may not have access to how the API is fulfilled.

Your API developers will either supply documentation or you can look at the
client models.  The client models will describe what functionality is available
to you.  Follow the your API developers instructions on how to setup the API or
refer to the [installation steps](install.md) for options.

In your application you will have a `setup!` method similar to the following:

  ````ruby
    Daylight::API.setup!(endpoint: 'http://api.company.com/')
  ````

#### Table of Contents
* [Client Model Example](#client-model-example)
* [ActiveResource Overview](#active-resource-overview)
* [Refinements](#refinements)
** [Conditions](#conditions)
** [Order](#order)
** [Limit and Offset](#limit-and-offset)
** [Scopes and Remotes](#scopes-and-remotes)
** [Chaining](#chaining)
* [Associations](#associations)
** [Nested Objects](#nested-objects)
** [Building Objects](#building-objects)
** [Updating Objects](#updating-objects)
** [More Chaining](#more-chaining)
* [Error Handling](#error-handling)
* [Optimizations](#optimizations)
** [Request Frequency](#request-frequency)
** [Response Size](#response-size)

## Client Model Example

Imagine you are building a blog, the client models that act as proxy to the
server-side are with which you will be interacting.

As we describe what Daylight can do in addition to `ActiveResource`
refer to these client models in the following `Post` example:

  ````ruby
    class API::V1::Post < Daylight::API
      scope :published<commit_msg>organizing<commit_after># Daylight Users Guide

Daylight is extensions built on top of
[ActiveResource](https://github.com/rails/activeresource).
Everything you can do with `ActiveResource` is available to you in Daylight.

Once you have an API [developed](develop.md) with Daylight, you will want to be
able to use it.  As an end-user of an API, it may be distributed to you in a
gem (or other means) and you may not have access to how the API is fulfilled.

Your API developers will either supply documentation or you can look at the
client models.  The client models will describe what functionality is available
to you.  Follow the your API developers instructions on how to setup the API or
refer to the [installation steps](install.md) for options.

In your application you will have a `setup!` method similar to the following:

  ````ruby
    Daylight::API.setup!(endpoint: 'http://api.company.com/')
  ````

#### Table of Contents
* [Client Model Example](#client-model-example)
* [ActiveResource Overview](#active-resource-overview)
* [Refinements](#refinements)
** [Conditions](#conditions)
** [Order](#order)
** [Limit and Offset](#limit-and-offset)
** [Scopes](#scopes)
** [Chaining](#chaining)
* [Remote Methods](#remote-methods)
* [Associations](#associations)
** [Nested Objects](#nested-objects)
** [Building Objects](#building-objects)
** [Updating Objects](#updating-objects)
** [More Chaining](#more-chaining)
* [Error Handling](#error-handling)
* [Optimizations](#optimizations)
** [Request Frequency](#request-frequency)
** [Response Size](#response-size)

## Client Model Example

Imagine you are building a blog, the client models that act as proxy to the
server-side are with which you will be interacting.

As we describe what Daylight can do in addition to `ActiveResource`
refer to these client models in the following `Post` example:

  ````ruby
    class API::V1::Post < Daylight::API
      scope :published
{'fraction_non_alphanumeric': 0.11467771162309086, 'fraction_numerical': 0.0005177323323841574, 'mean_word_length': 5.202247191011236, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2298807', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1039, 'n_words': 439}