Class: C::Pointer

Inherits:
Object
  • Object
show all
Defined in:
lib/cast-to-yaml/to_yaml.rb

Overview

IndirectTypes

Instance Method Summary collapse

Instance Method Details

#to_h_split(declaration = nil) ⇒ Object



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/cast-to-yaml/to_yaml.rb', line 257

def to_h_split(declaration = nil)
  res = {}
  res["kind"] = "pointer"
  res["const"] = true if const?
  res["restrict"] = true if restrict?
  res["volatile"] = true if volatile?
  if type
    if declaration
      res["type"] = type.to_h_split(declaration)
    else
      res["type"] = type.to_h_split
    end
  else
    res["type"] = declaration.type.to_h_split
  end
  res
end