new manager_base(response_parser)

Contructor for the REST manager.

See also: module:bbop-registry

Parameter

Name Type Optional Description

response_parser

Object

 

the response handler class to use for each call

Returns

Object rest manager object

Methods

assemble() → String

Assemble the resource and arguments into a URL string.

May not be appropriate for all subclasses or commands (and probably only useful in the context of GET calls, etc.). Often used as a helper, etc.

Also see:

Returns

String url string

debug([p]) → Boolean

Turn on or off the verbose messages. Uses , so they should come out everywhere.

Parameter

Name Type Optional Description

p

Boolean

Yes

true or false for debugging

Returns

Boolean the current state of debugging

fetch([url][, payload], method) → Object

It should combine the URL, payload, and method in the ways appropriate to the subclass engine.

This model class always returns true, with set messages; the "payload" is fed as the argument into the response handler.

What we're aiming for is a system that:

  • runs callbacks (in order: success, error, return)
  • return response

Parameters

Name Type Optional Description

url

String

Yes

update resource target with string

payload

Object

Yes

object to represent arguments

method

String

 

GET, POST, etc.

Returns

Object response (given the incoming payload)

method([method]) → (String or null)

The method to use to get the resource, as a string.

Parameter

Name Type Optional Description

method

String

Yes

update aquisition method with string

Returns

(String or null) the string or null

payload([payload]) → (Object or null)

The information to deliver to the resource.

Parameter

Name Type Optional Description

payload

Object

Yes

update payload information

Returns

(Object or null) a copy of the current payload

resource([in_url]) → (String or null)

The base target URL for our operations.

Parameter

Name Type Optional Description

in_url

String

Yes

update resource target with string

Returns

(String or null) the url as string (or null)

start([url][, payload], method) → Object

It should combine the URL, payload, and method in the ways appropriate to the subclass engine.

This model class always returns true, with set messages; the "payload" is fed as the argument into the response handler.

What we're aiming for is a system that:

  • runs callbacks (in order: success, error, return)
  • return promise (delivering response)

Parameters

Name Type Optional Description

url

String

Yes

update resource target with string

payload

Object

Yes

object to represent arguments

method

String

 

GET, POST, etc.

Returns

Object promise for the processed response subclass

to_string() → String

Output writer for this object/class. See the documentation in on and .

Returns

String string