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