Ruby Mapping for Identifiers
A Slice identifier maps to an identical Ruby identifier. For example, the Slice identifier Clock
becomes the Ruby identifier Clock
. There are two exceptions to this rule:
- Ruby requires the names of classes, modules, and constants to begin with an upper case letter. 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. For example, the Slice identifier
bankAccount
is mapped asBankAccount
. - 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
.
You should try to avoid such identifiers as much as possible.