class Ikra::Types::PrimitiveType

Constants

Bool
Float
Int
Nil
Void

Attributes

c_size[R]
class_id[R]

Public Class Methods

new(c_type, ruby_type, c_size, ffi_type, class_id) click to toggle source
# File lib/types/types/primitive_type.rb, line 11
def initialize(c_type, ruby_type, c_size, ffi_type, class_id)
    @c_type = c_type
    @ruby_type = ruby_type
    @c_size = c_size
    @ffi_type = ffi_type
    @class_id = class_id
end

Public Instance Methods

==(other) click to toggle source
# File lib/types/types/primitive_type.rb, line 25
def ==(other)
    return other.is_a?(PrimitiveType) && other.class_id == class_id
end
is_primitive?() click to toggle source
# File lib/types/types/primitive_type.rb, line 41
def is_primitive?
    true
end
to_c_type() click to toggle source
# File lib/types/types/primitive_type.rb, line 33
def to_c_type
    @c_type
end
to_ffi_type() click to toggle source
# File lib/types/types/primitive_type.rb, line 37
def to_ffi_type
    @ffi_type
end
to_ruby_type() click to toggle source
# File lib/types/types/primitive_type.rb, line 29
def to_ruby_type
    @ruby_type
end
to_s() click to toggle source
# File lib/types/types/primitive_type.rb, line 45
def to_s
    "<primitive: #{@c_type}>"
end