         
         return biceps
     }
-    
+
     open func configuration(_ block: (BicepsConfiguration) -> Void) -> Biceps {
         block(self.configuration)
         return self

                 fail: @escaping FailBlock) -> URLSessionTask?
}

extension Biceps {
    open func requestJSON() {
        if let combinedRequest = self.combinedRequest, combinedRequest.count > 0 {
            for biceps in combinedRequest {
                biceps.requestJSON()
            }
        } else {
            request(for: self.internalType, contentType: "")
        }
    }
    
    var requester: BicepsRequestable {

    
    open func hasDependency() -> Bool {
        return dependency != nil
    }
}

extension Biceps: CustomStringConvertible {
    public var description: String {
        return self.internalName
    }
}

class BicepsOperation: Operation {
    
    var biceps: Biceps
    
    var _finished: Bool = false {
        willSet {
            self.willChangeValue(forKey: "isFinished")
        }
        
        didSet {
            self.didChangeValue(forKey: "isFinished")
        }
    }
    var _executing: Bool = false {
        willSet {
            self.willChangeValue(forKey: "isExecuting")
        }
        
        didSet {
            self.didChangeValue(forKey: "isExecuting")
        }
    }
    
    init(_ biceps: Biceps) {
        self.biceps = biceps
    }

    override func start() {

        guard self.isReady else {
            return
        }
        
        let progress = biceps.internalProgressBlock
        let success = biceps.internalSuccessBlock
        let fail = biceps.internalFailBlock

        biceps.progress({ (_progress) in
            self._finished = false
            self._executing = true
            
            progress(_progress)
        }).success { (result) in
            self._finished = true
            self._executing = false
            
            success(result)
        }.fail({ (error) in
            self._finished = true
            self._executing = false
            
            fail(error)
        }).requestJSON()
    }
    
    override var isExecuting: Bool {
        return _executing
    }
    
    override var isFinished: Bool {
        return _finished
    }
}

