Class: C::Function

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, no_types = false) ⇒ Object



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/cast-to-yaml/to_yaml.rb', line 286

def to_h_split(declaration, no_types=false)
  res = {}
  res["kind"] = "function"
  if type
    res["type"] = type.to_h_split(declaration)
  else
    res["type"] = declaration.type.to_h_split
  end
  if !params.nil?
    res["params"] = if no_types
        params.collect{|p| p.name }
      else
        params.collect{|p| p.to_h_split }
      end
  end
  if var_args?
    res["var_args"] = true
  end
  res
end