Class: C::Enum
- Inherits:
-
Object
- Object
- C::Enum
- Defined in:
- lib/cast-to-yaml/to_yaml.rb
Instance Method Summary collapse
Instance Method Details
#to_h ⇒ Object
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/cast-to-yaml/to_yaml.rb', line 142 def to_h res = {} res["kind"] = "enum" if name res["name"] = name else m = [] members.each { |mem| m.push mem.to_h } res["members"] = m end res["const"] = true if const? res["restrict"] = true if restrict? res["volatile"] = true if volatile? res end |