Diffusion Apple API  6.2.0
Unified Client Library for iOS, tvOS and OS X / macOS
 All Classes Functions Variables Properties Pages
Class Methods | Instance Methods | List of all members
PTDiffusionResponder Class Reference

Introduction

Responder provided with requests, used to dispatch responses.

See Also
PTDiffusionRequestHandler
PTDiffusionBinary
PTDiffusionJSON
PTDiffusionPrimitive
PTDiffusionRecordV2
Since
6.0
Inheritance diagram for PTDiffusionResponder:

Class Methods

(instancetype) + NS_UNAVAILABLE
 

Instance Methods

(instancetype) - NS_UNAVAILABLE
 
(void) - respondWithResponse:
 
(void) - rejectWithReason:
 
(void) - respondWithBinary:
 
(void) - respondWithJSON:
 
(void) - respondWithDouble:
 
(BOOL) - respondWithDoubleFloatNumber:error:
 
(void) - respondWithLongLong:
 
(BOOL) - respondWithInt64Number:error:
 
(BOOL) - respondWithString:error:
 
(void) - respondWithRecord:
 

Method Documentation

- (void) rejectWithReason: (NSString *)  reason

Dispatch a rejection to a request, indicating that a response could not be generated.

Parameters
reasonFreeform text to provide to the requestor by way of explanation for this rejection.
Exceptions
NSInvalidArgumentExceptionRaised if the reason argument is nil.
Since
6.0
- (void) respondWithBinary: (PTDiffusionBinary *)  binary

Dispatch a response to a request.

Parameters
binaryThe value to send in response.
Exceptions
NSInvalidArgumentExceptionRaised if the binary argument is nil.
Since
6.0

Provided by category PTDiffusionResponder(PTDiffusionBinary).

- (void) respondWithDouble: (double)  value

Dispatch a double-precision floating point (Eight-byte IEEE 754) response to a request.

Parameters
valueThe value to send in response.
Since
6.0

Provided by category PTDiffusionResponder(PTDiffusionPrimitive).

- (BOOL) respondWithDoubleFloatNumber: (nullable NSNumber *)  number
error: (NSError **)  error 

Dispatch a double-precision floating point (Eight-byte IEEE 754) response to a request.

Parameters
numberThe value to send in response. This may be nil in order to send a 'null' response.
errorLocation to store a reason if this method returns NO to indicate failure.
Returns
YES if a response was queued for dispatch or NO if the supplied number could not be encoded using this data type.
Since
6.0

Provided by category PTDiffusionResponder(PTDiffusionPrimitive).

- (BOOL) respondWithInt64Number: (nullable NSNumber *)  number
error: (NSError **)  error 

Dispatch a 64-bit integer response to a request.

Parameters
numberThe value to send in response. This may be nil in order to send a 'null' response.
errorLocation to store a reason if this method returns NO to indicate failure.
Returns
YES if a response was queued for dispatch or NO if the supplied number could not be encoded using this data type.
Since
6.0

Provided by category PTDiffusionResponder(PTDiffusionPrimitive).

- (void) respondWithJSON: (PTDiffusionJSON *)  json

Dispatch a response to a request.

Parameters
jsonThe value to send in response.
Exceptions
NSInvalidArgumentExceptionRaised if the json argument is nil.
Since
6.0

Provided by category PTDiffusionResponder(PTDiffusionJSON).

- (void) respondWithLongLong: (long long)  value

Dispatch a 64-bit integer response to a request.

Parameters
valueThe value to send in response.
Since
6.0

Provided by category PTDiffusionResponder(PTDiffusionPrimitive).

- (void) respondWithRecord: (PTDiffusionRecordV2 *)  record

Dispatch a response to a request.

Parameters
recordThe value to send in response.
Exceptions
NSInvalidArgumentExceptionRaised if the record argument is nil.
Since
6.0

Provided by category PTDiffusionResponder(PTDiffusionRecordV2).

- (void) respondWithResponse: (PTDiffusionResponse *)  response

Dispatch a response to a request.

Parameters
responseThe value to send in response.
Exceptions
NSInvalidArgumentExceptionRaised if the response argument is nil.
Since
6.1
- (BOOL) respondWithString: (nullable NSString *)  string
error: (NSError **)  error 

Dispatch a string response to a request.

Parameters
stringThe value to send in response. This may be nil in order to send a 'null' response.
errorLocation to store a reason if this method returns NO to indicate failure.
Returns
YES if a response was queued for dispatch or NO if the supplied string could not be encoded using this data type.
Since
6.0

Provided by category PTDiffusionResponder(PTDiffusionPrimitive).