Class: MilkTea::Types::DynVtable

Inherits:
Base
  • Object
show all
Defined in:
lib/milk_tea/core/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.



1676
1677
1678
1679
1680
1681
1682
# File 'lib/milk_tea/core/types.rb', line 1676

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.



1674
1675
1676
# File 'lib/milk_tea/core/types.rb', line 1674

def fields
  @fields
end

#hashObject (readonly)

Returns the value of attribute hash.



1690
1691
1692
# File 'lib/milk_tea/core/types.rb', line 1690

def hash
  @hash
end

#interface_nameObject (readonly)

Returns the value of attribute interface_name.



1674
1675
1676
# File 'lib/milk_tea/core/types.rb', line 1674

def interface_name
  @interface_name
end

#linkage_nameObject (readonly)

Returns the value of attribute linkage_name.



1674
1675
1676
# File 'lib/milk_tea/core/types.rb', line 1674

def linkage_name
  @linkage_name
end

Instance Method Details

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

Returns:

  • (Boolean)


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

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

#field(name) ⇒ Object



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

def field(name)
  @fields[name]
end

#to_sObject



1692
1693
1694
# File 'lib/milk_tea/core/types.rb', line 1692

def to_s
  linkage_name
end