| 11452 | } |
| 11453 | |
| 11454 | public Object currency(Object code) |
| 11455 | { |
| 11456 | Object keys = Helpers.objectKeys(this.currencies); |
| 11457 | Object numCurrencies = Helpers.getArrayLength(keys); |
| 11458 | if (Helpers.isTrue(Helpers.isEqual(numCurrencies, 0))) |
| 11459 | { |
| 11460 | throw new ExchangeError((String)Helpers.add(this.id, " currencies not loaded")) ; |
| 11461 | } |
| 11462 | if (Helpers.isTrue((code instanceof String))) |
| 11463 | { |
| 11464 | if (Helpers.isTrue(Helpers.inOp(this.currencies, code))) |
| 11465 | { |
| 11466 | return Helpers.GetValue(this.currencies, code); |
| 11467 | } else if (Helpers.isTrue(Helpers.inOp(this.currencies_by_id, code))) |
| 11468 | { |
| 11469 | return Helpers.GetValue(this.currencies_by_id, code); |
| 11470 | } |
| 11471 | } |
| 11472 | throw new ExchangeError((String)Helpers.add(Helpers.add(this.id, " does not have currency code "), code)) ; |
| 11473 | } |
| 11474 | |
| 11475 | public Object market(Object symbol) |
| 11476 | { |