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
- #class_id ⇒ Object
- #is_primitive? ⇒ Boolean
- #is_union_type? ⇒ Boolean
- #to_c_type ⇒ Object
- #to_ruby_type ⇒ Object
Instance Method Details
#class_id ⇒ Object
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
19 20 21 |
# File 'lib/types/ruby_type.rb', line 19 def is_primitive? false end |
#is_union_type? ⇒ Boolean
23 24 25 |
# File 'lib/types/ruby_type.rb', line 23 def is_union_type? false end |
#to_c_type ⇒ Object
15 16 17 |
# File 'lib/types/ruby_type.rb', line 15 def to_c_type raise NotImplementedError end |
#to_ruby_type ⇒ Object
11 12 13 |
# File 'lib/types/ruby_type.rb', line 11 def to_ruby_type raise NotImplementedError end |