Method: Schema::Node#to_obj

Defined in:
lib/capnp/generator/schema.capnp.rb

#to_objObject



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/capnp/generator/schema.capnp.rb', line 301

def to_obj
  res = {}
  res["id"] = id
  res["display_name"] = display_name&.to_obj
  res["display_name_prefix_length"] = display_name_prefix_length
  res["scope_id"] = scope_id
  res["parameters"] = parameters&.to_obj
  res["is_generic"] = is_generic
  res["nested_nodes"] = nested_nodes&.to_obj
  res["annotations"] = annotations&.to_obj
  case which?
  when Which::File then res["file"] = file
  when Which::Struct then res["struct"] = struct.to_obj
  when Which::Enum then res["enum"] = enum.to_obj
  when Which::Interface then res["interface"] = interface.to_obj
  when Which::Const then res["const"] = const.to_obj
  when Which::Annotation then res["annotation"] = annotation.to_obj
  end
  res
end