import { Block } from '../blocks' ; import { Argument } from '.' ; category export class Attribute extends Argument { param block param attrName constructor ( block , attrName ) { super ( Attribute . #constructArgument ( block , attrName ) ) ; } static #constructArgument ( block , attrName ) { if ( ! block ) { throw new Error ( 'Attribute block cannot be null.' ) ; } if ( ! attrName || ! attrName . trim ( ) ) { throw new Error ( 'Attribute name cannot be empty.' ) ; } return `${ block . asArgument ( ) . toTerraform ( ) }.${ attrName . trim ( ) }` ; } } param block param name category export const attr = ( block , name ) : Attribute => new Attribute ( block , name ) ;