Module: Ikra::Types::RubyType

Included in:
ArrayType, ClassType, PrimitiveType, UnionType, UnknownType
Defined in:
lib/types/ruby_type.rb

Overview

Defines the minimal interface for Ikra types. Instances of UnionType are expected in most cases.

Constant Summary collapse

@@next_class_id =
0

Instance Method Summary collapse

Instance Method Details

#class_idObject



27
28
29
30
31
32
33
34
# File 'lib/types/ruby_type.rb', line 27

def class_id
    if @class_id == nil
        @class_id = @@next_class_id
        @@next_class_id += 1
    end

    @class_id
end

#is_primitive?Boolean

Returns:



19
20
21
# File 'lib/types/ruby_type.rb', line 19

def is_primitive?
    false
end

#is_union_type?Boolean

Returns:



23
24
25
# File 'lib/types/ruby_type.rb', line 23

def is_union_type?
    false
end

#to_c_typeObject

Raises:



15
16
17
# File 'lib/types/ruby_type.rb', line 15

def to_c_type
    raise NotImplementedError
end

#to_ruby_typeObject

Raises:



11
12
13
# File 'lib/types/ruby_type.rb', line 11

def to_ruby_type
    raise NotImplementedError
end