Ruby Mapping for Local Classes

On this page:

Mapped Ruby Class

A local Slice class is mapped to a Ruby class with the same name. For example:

Slice
module M
{
    local class Example
    {
        ...
    }
}

is mapped to the Ruby class Example:

Ruby
class Example
    ...
end

LocalObject in Ruby

Local Slice classes implicitly derive from LocalObject, which is mapped to the native Object class in Ruby.

Mapping for Local Interface Inheritance in Ruby

A local Slice class can extend another local Slice class, and can implement one or more local Slice interfaces. extends is mapped to class inheritance in Ruby, but implements is not mapped. For example:

Slice
module M
{
    local interface A {}
    local interface B {}
    
    local class C implements A, B {}
    local class D extends C {}
}

is mapped to:

Ruby
# No mapping for A or B
class C
    ...
end
class D < C
    ...
end