Class: C::Struct
- Inherits:
-
Object
- Object
- C::Struct
- Defined in:
- lib/cast-to-yaml/to_yaml.rb
Overview
DirectTypes
Instance Method Summary collapse
Instance Method Details
#to_h ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/cast-to-yaml/to_yaml.rb', line 102 def to_h res = {} res["kind"] = "struct" if name res["name"] = name else m = [] members.each { |mem| m += mem.to_a } res["members"] = m end res["const"] = true if const? res["restrict"] = true if restrict? res["volatile"] = true if volatile? res end |