<commit_before>Moya
====

The README is pretty basic – it describes Moya as "network abstraction layer", 
whatever that means, amirite? I mean, what the heck does that even mean? 

Well, Moya is about working at *high levels of abstraction* in your application. 
It accomplishes this with the following pipline. 

![Pipeline](https://raw.github.com/ashfurrow/Moya/master/web/pipeline.png)

You use Moya to define a Swift `enum` that will be your *target*. Then, the rest
of your app deals *only* with those targets. Targets are usually some action 
that you want to take on the API. 

Optionally, your network layer *can* choose to customize the process of 
transforming a target enum value into an `Endpoint` instance that Moya will use
and finally from that `Endpoint` into an actual `NSURLRequest`. But it *doesn't
have to* – Moya uses sane defaults wherever possible. 

If there is something you want to change about the behaviour of Moya, there is 
probably a way to do it without modifying the library. Moya is designed to be 
super-flexible and accommodate the needs of every developer. It's less of a code
framework and more of a framework of how to think about network requests. 

This document's purpose is to guide you through a simple use case for Moya and
slowly progress to more advanced uses. Remember, if at any point you have a 
question, just [open an issue](http://github.com/AshFurrow/Moya/issues/new) and
we'll get you some help.

Moya Setup
==========

Setup instructions can be found in the [project README](http://AshFurrow.com/Moya#Installation).

Basic Usage
===========

Basic usage of Moya can also be found in the [project README](http://AshFurrow.com/Moya).
However, let's revisit that a little bit and go into some more detail. 

There's a clear line between what is inside Moya and what is inside your app. 
*You* provide a Swift enum that Moya uses with Swift generics to make API calls.
This enum represents, at a high-level, the different API endpoints you can reach
on your server. In Moya terms, this is called a "*target*." For example:

```swift
enum GitHub {
    case Zen
    case UserProfile(String)
}
```

This enum is yours, but it has a few requirements. It must conform to the 
`MoyaPath` and `MoyaTarget` protocols, which you should using extensions 
*separate* from the main enum declaration.<commit_msg>Fixes #89.<commit_after>Moya
====

The README is pretty basic – it describes Moya as "network abstraction layer", 
whatever that means, amirite? I mean, what the heck does that even mean? 

Well, Moya is about working at *high levels of abstraction* in your application. 
It accomplishes this with the following pipline. 

![Pipeline](https://raw.github.com/ashfurrow/Moya/master/web/pipeline.png)

You use Moya to define a Swift `enum` that will be your *target*. Then, the rest
of your app deals *only* with those targets. Targets are usually some action 
that you want to take on the API. 

Optionally, your network layer *can* choose to customize the process of 
transforming a target enum value into an `Endpoint` instance that Moya will use
and finally from that `Endpoint` into an actual `NSURLRequest`. But it *doesn't
have to* – Moya uses sane defaults wherever possible. 

If there is something you want to change about the behaviour of Moya, there is 
probably a way to do it without modifying the library. Moya is designed to be 
super-flexible and accommodate the needs of every developer. It's less of a code
framework and more of a framework of how to think about network requests. 

This document's purpose is to guide you through a simple use case for Moya and
slowly progress to more advanced uses. Remember, if at any point you have a 
question, just [open an issue](http://github.com/AshFurrow/Moya/issues/new) and
we'll get you some help.

Moya Setup
==========

Setup instructions can be found in the [project README](http://github.com/ashfurrow/Moya#Installation).

Basic Usage
===========

Basic usage of Moya can also be found in the [project README](http://github.com/ashfurrow/Moya).
However, let's revisit that a little bit and go into some more detail. 

There's a clear line between what is inside Moya and what is inside your app. 
*You* provide a Swift enum that Moya uses with Swift generics to make API calls.
This enum represents, at a high-level, the different API endpoints you can reach
on your server. In Moya terms, this is called a "*target*." For example:

```swift
enum GitHub {
    case Zen
    case UserProfile(String)
}
```

This enum is yours, but it has a few requirements. It must conform to the 
`MoyaPath` and `MoyaTarget` protocols, which you should using extensions 
*separate* from the main enum declaration.
{'fraction_non_alphanumeric': 0.07129217059197963, 'fraction_numerical': 0.000424358158285593, 'mean_word_length': 4.23196448390677, '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': '1493050', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1260, 'n_words': 714}