Home Manual Reference Source Repository
private class | source

GeoserviceResolver

Extends:

CurrencyResolver → GeoserviceResolver

Gets currency information from the ESC Geoservice.

Constructor Summary

Public Constructor
public

Create new instance of GeoserviceResolver.

Member Summary

Private Members
private
private
private

_ratesPromise: Promise<Object, Error

private

Method Summary

Public Methods
public

async getConversionRate(from: String, to: String): Number

Get conversion rate for a specific currency pair.

public

List the available currencies.

Private Methods
private

Retrieves rates from the server.

Inherited Summary

From class CurrencyResolver
public

async getConversionRate(from: String, to: String): Number

Get conversion rate for a specific currency pair.

public

List the available currencies.

Public Constructors

public constructor() source

Create new instance of GeoserviceResolver.

Private Members

private _geoService: * source

private _rates: Object source

private _ratesPromise: Promise<Object, Error source

private _requested: Boolean source

Public Methods

public async getConversionRate(from: String, to: String): Number source

Get conversion rate for a specific currency pair.

Override:

CurrencyResolver#getConversionRate

Params:

NameTypeAttributeDescription
from String
to String

Return:

Number

Throw:

Error

CurrencyResolver should implement getConversionRate

public async listCurrencyCodes(): String[] source

List the available currencies.

Override:

CurrencyResolver#listCurrencyCodes

Return:

String[]

Throw:

Error

CurrencyResolver should implement listCurrencyCodes

Private Methods

private async _getRates(): Promise<Object, Error> source

Retrieves rates from the server. Rates are cached in memory.

Return:

Promise<Object, Error>