Table of Contents

RbaEraWorkbook Class

Definition

Namespace
Bodu.Financial.ExchangeRates
Assembly
Bodu.Financial.ExchangeRates.Rba.dll
Package
Bodu.Financial.ExchangeRates.Rba 0.7.1
Source
RbaEraWorkbook.cs

Identifies one of the date-range files in which the Reserve Bank of Australia publishes its historical daily exchange rates.

public sealed class RbaEraWorkbook
Inheritance
RbaEraWorkbook
Inherited Members
Extension Methods

Remarks

The RBA splits its historical daily exchange-rate data into a small set of multi-year files plus an open-ended "current" file. Each era maps to one downloadable .xls file and the inclusive date range it covers. The default catalogue is exposed through Default and can be overridden via the provider options if the RBA changes its file names.

Constructors

RbaEraWorkbook(string, DateOnly, DateOnly?)

Initializes a new instance of the RbaEraWorkbook class.

public RbaEraWorkbook(string label, DateOnly start, DateOnly? end)

Parameters

label string

The era label, also used to form the file name.

start DateOnly

The first calendar date the era covers.

end DateOnly?

The last calendar date the era covers, or null when the era is open-ended.

Properties

Default

Gets the default catalogue of RBA historical daily exchange-rate eras, from 1983 to the current file.

public static IReadOnlyList<RbaEraWorkbook> Default { get; }

Property Value

IReadOnlyList<RbaEraWorkbook>

The ordered, immutable default era catalogue.

End

Gets the last calendar date the era covers, or null when the era is open-ended.

public DateOnly? End { get; }

Property Value

DateOnly?

The inclusive end date, or null for the open-ended current era.

FileName

Gets the file name of the era's workbook, relative to the provider's base URL.

public string FileName { get; }

Property Value

string

The workbook file name, formed by appending .xls to Label.

Label

Gets the era label (for example, 2023-current).

public string Label { get; }

Property Value

string

The era label.

Start

Gets the first calendar date the era covers.

public DateOnly Start { get; }

Property Value

DateOnly

The inclusive start date.

Methods

Covers(DateOnly)

Determines whether the era covers the specified date.

public bool Covers(DateOnly date)

Parameters

date DateOnly

The date to test.

Returns

bool

true when date falls within the era; otherwise false.

ForDate(DateOnly, IReadOnlyList<RbaEraWorkbook>)

Finds the era in eras that covers the specified date.

public static RbaEraWorkbook? ForDate(DateOnly date, IReadOnlyList<RbaEraWorkbook> eras)

Parameters

date DateOnly

The date to resolve.

eras IReadOnlyList<RbaEraWorkbook>

The era catalogue to search.

Returns

RbaEraWorkbook

The covering era, or null when no era covers date.

Exceptions

ArgumentNullException

Thrown when eras is null.

Applies to

ProductVersions
.NET8, 10