Skip to content

Commit

Permalink
Feat: define RandomBeerRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
Oni-zerone committed Feb 24, 2019
1 parent be8cb74 commit 8a7e603
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example/PunkAPI/ViewController.swift
Expand Up @@ -21,7 +21,7 @@ class ViewController: UIViewController {

@IBAction func loadBeerAction(_ sender: Any) {

PunkAPI().get(BeerRequest(id: 6), queue: .main) { [weak self] beersResult in
PunkAPI().get(RandomBeerRequest(), queue: .main) { [weak self] beersResult in

guard let strongSelf = self else { return }
switch beersResult {
Expand Down
17 changes: 17 additions & 0 deletions PunkAPI/Classes/Request/RandomBeerRequest.swift
@@ -0,0 +1,17 @@
//
// RandomBeerRequest.swift
// PunkAPI
//
// Created by Andrea Altea on 24/02/2019.
//

import Foundation

public struct RandomBeerRequest: Request {

public var path: String {
return "beers/random"
}

public init() { }
}

0 comments on commit 8a7e603

Please sign in to comment.