Method: Puppet::Pops::Model::TypeMapping.create

Defined in:
lib/puppet/pops/model/ast.rb

.create(locator, offset, length, type_expr = nil, mapping_expr = nil) ⇒ Object



2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
# File 'lib/puppet/pops/model/ast.rb', line 2261

def self.create(locator, offset, length, type_expr = nil, mapping_expr = nil)
  ta = Types::TypeAsserter
  attrs = _pcore_type.attributes(true)
  ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
  ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
  ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
  ta.assert_instance_of('Puppet::AST::TypeMapping[type_expr]', attrs['type_expr'].type, type_expr)
  ta.assert_instance_of('Puppet::AST::TypeMapping[mapping_expr]', attrs['mapping_expr'].type, mapping_expr)
  new(locator, offset, length, type_expr, mapping_expr)
end