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.



1645
1646
1647
1648
1649
1650
1651
# File 'lib/milk_tea/core/types/types.rb', line 1645

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.



1643
1644
1645
# File 'lib/milk_tea/core/types/types.rb', line 1643

def fields
  @fields
end

#hashObject (readonly)

Returns the value of attribute hash.



1659
1660
1661
# File 'lib/milk_tea/core/types/types.rb', line 1659

def hash
  @hash
end

#interface_nameObject (readonly)

Returns the value of attribute interface_name.



1643
1644
1645
# File 'lib/milk_tea/core/types/types.rb', line 1643

def interface_name
  @interface_name
end

#linkage_nameObject (readonly)

Returns the value of attribute linkage_name.



1643
1644
1645
# File 'lib/milk_tea/core/types/types.rb', line 1643

def linkage_name
  @linkage_name
end

Instance Method Details

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

Returns:

  • (Boolean)


1653
1654
1655
# File 'lib/milk_tea/core/types/types.rb', line 1653

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

#field(name) ⇒ Object



1665
1666
1667
# File 'lib/milk_tea/core/types/types.rb', line 1665

def field(name)
  @fields[name]
end

#to_sObject



1661
1662
1663
# File 'lib/milk_tea/core/types/types.rb', line 1661

def to_s
  linkage_name
end