Class: C::Array

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

Instance Method Summary collapse

Instance Method Details

#to_h_split(declaration = nil) ⇒ Object



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/cast-to-yaml/to_yaml.rb', line 277

def to_h_split(declaration = nil)
  res = {}
  res["kind"] = "array"
  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
  if length
    res["length"] = length.to_s
  end
  res
end