Method: Puppet::Pops::Types::PInitType#really_instance?

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

#really_instance?(o, guard = nil) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/puppet/pops/types/p_init_type.rb', line 38

def really_instance?(o, guard = nil)
  if @type.nil?
    TypeFactory.rich_data.really_instance?(o)
  else
    assert_initialized
    guarded_recursion(guard, 0) do |g|
      v = @type.really_instance?(o, g)
      if v < 1
        if @single_type
          s = @single_type.really_instance?(o, g)
          v = s if s > v
        end
      end
      if v < 1
        if @other_type
          s = @other_type.really_instance?(o, g)
          s = @other_type.really_instance?([o], g) if s < 0 && @has_optional_single
          v = s if s > v
        end
      end
      v
    end
  end
end