class FFIDB::Union

Public Class Methods

new(name, fields = {}, comment = nil) click to toggle source

@param [Symbol, to_sym] name @param [Map<Symbol, Type>] fields @param [String, to_s] comment

Calls superclass method
# File lib/ffidb/union.rb, line 13
def initialize(name, fields = {}, comment = nil)
  super(name.to_sym, fields || {}, comment&.to_s)
end

Public Instance Methods

to_h() click to toggle source

@return [Hash<Symbol, Type>]

# File lib/ffidb/union.rb, line 29
def to_h
  {
    name: self.name.to_s,
    comment: self.comment,
    fields: self.fields,
  }.delete_if { |k, v| v.nil? }
end
to_s() click to toggle source

@return [String]

# File lib/ffidb/union.rb, line 23
def to_s
  "union #{self.name}"
end
union?() click to toggle source

@return [Boolean]

# File lib/ffidb/union.rb, line 19
def union?() return true end