encode<V> static method

V encode<V>(
  1. ExchangeRate instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  ExchangeRate instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeString(
    'id',
    instance.id,
  );
  container.encodeString(
    'object',
    'exchange_rate',
  );
  container.encodeMap(
    'rates',
    (container) => instance.rates.forEach((
      key,
      value,
    ) =>
        container.encodeDouble(
          key,
          value,
        )),
  );
  return container.value;
}