class FFIDB::Typedef

Public Class Methods

new(name, type, comment = nil) click to toggle source

@param [Symbol, to_sym] name @param [Type] type @param [String, to_s] comment

Calls superclass method
# File lib/ffidb/typedef.rb, line 14
def initialize(name, type, comment = nil)
  super(name.to_sym, Type.for(type), comment&.to_s)
end

Public Instance Methods

to_h() click to toggle source

@return [Hash<Symbol, Type>]

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

@return [String]

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

@return [Boolean]

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