Class: MilkTea::Types::DynVtable

Inherits:
Base
  • Object
show all
Defined in:
lib/milk_tea/core/types/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#accept, #bitwise?, #boolean?, #children, #field_c_name, #float?, #integer?, #numeric?, #sendable?, #void?

Constructor Details

#initialize(interface_name, fields = {}) ⇒ DynVtable

Returns a new instance of DynVtable.



1687
1688
1689
1690
1691
1692
1693
# File 'lib/milk_tea/core/types/types.rb', line 1687

def initialize(interface_name, fields = {})
  @interface_name = interface_name
  @linkage_name = "mt_vtable_#{interface_name}"
  @fields = fields
  @hash = [self.class, @linkage_name].hash
  freeze
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



1685
1686
1687
# File 'lib/milk_tea/core/types/types.rb', line 1685

def fields
  @fields
end

#hashObject (readonly)

Returns the value of attribute hash.



1701
1702
1703
# File 'lib/milk_tea/core/types/types.rb', line 1701

def hash
  @hash
end

#interface_nameObject (readonly)

Returns the value of attribute interface_name.



1685
1686
1687
# File 'lib/milk_tea/core/types/types.rb', line 1685

def interface_name
  @interface_name
end

#linkage_nameObject (readonly)

Returns the value of attribute linkage_name.



1685
1686
1687
# File 'lib/milk_tea/core/types/types.rb', line 1685

def linkage_name
  @linkage_name
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


1695
1696
1697
# File 'lib/milk_tea/core/types/types.rb', line 1695

def eql?(other)
  other.is_a?(DynVtable) && other.linkage_name == linkage_name
end

#field(name) ⇒ Object



1707
1708
1709
# File 'lib/milk_tea/core/types/types.rb', line 1707

def field(name)
  @fields[name]
end

#to_sObject



1703
1704
1705
# File 'lib/milk_tea/core/types/types.rb', line 1703

def to_s
  linkage_name
end