Class: FFIDB::Union
Instance Method Summary
collapse
Methods included from Symbolic
#<=>, #enum?, #function?, #kind, #kind_weight, #struct?, #to_yaml, #typedef?
Constructor Details
#initialize(name, fields = {}, comment = nil) ⇒ Union
Returns a new instance of Union.
13
14
15
|
# File 'lib/ffidb/union.rb', line 13
def initialize(name, fields = {}, = nil)
super(name.to_sym, fields || {}, &.to_s)
end
|
Instance Method Details
#to_h ⇒ Hash<Symbol, Type>
29
30
31
32
33
34
35
|
# File 'lib/ffidb/union.rb', line 29
def to_h
{
name: self.name.to_s,
comment: self.,
fields: self.fields,
}.delete_if { |k, v| v.nil? }
end
|
#to_s ⇒ String
23
24
25
|
# File 'lib/ffidb/union.rb', line 23
def to_s
"union #{self.name}"
end
|
#union? ⇒ Boolean
19
|
# File 'lib/ffidb/union.rb', line 19
def union?() return true end
|