Table of Contents Previous Next
Logo
Client-Side Slice-to-Ruby Mapping : 26.3 Mapping for Identifiers
Copyright © 2003-2010 ZeroC, Inc.

26.3 Mapping for Identifiers

Slice identifiers map to an identical Ruby identifier. For example, the Slice identi­fier Clock becomes the Ruby identifier Clock. There are two exceptions to this rule:
1. If a Slice identifier maps to the name of a Ruby class, module, or constant, and the Slice identifier does not begin with an upper case letter, the mapping replaces the leading character with its upper case equivalent.1 For example, the Slice identifier bankAccount is mapped as BankAccount.
2. If a Slice identifier is the same as a Ruby keyword, the corresponding Ruby identifier is prefixed with an underscore. For example, the Slice identifier while is mapped as _while.2

1
Ruby requires the names of classes, modules, and constants to begin with an upper case letter.

2
As suggested in Section 4.5.3 on page 92, you should try to avoid such identifiers as much as possible.


Table of Contents Previous Next
Logo