Method: Puppet::Pops::Types::TypeFormatter#string_Object

Defined in:
lib/puppet/pops/types/type_formatter.rb

#string_Object(t) ⇒ Object



339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/puppet/pops/types/type_formatter.rb', line 339

def string_Object(t)
  type = TypeCalculator.infer(t)
  if type.is_a?(PObjectTypeExtension)
    type = type.base_type
  end
  if type.is_a?(PObjectType)
    init_hash = type.extract_init_hash(t)
    @bld << type.name << '('
    if @indent
      append_indented_string(init_hash, @indent, @indent_width, true)
      @bld.chomp!
    else
      append_string(init_hash)
    end
    @bld << ')'
  else
    @bld << 'Instance of '
    append_string(type)
  end
end