From 0e116480788b97fc71c61c0313525bcf58be6515 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Sat, 8 Jan 2022 16:11:40 +0000 Subject: [PATCH] Update vban.ps1 move $this.id into base class remove unnecessary assignment --- lib/vban.ps1 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/vban.ps1 b/lib/vban.ps1 index aa32731..2257b1b 100644 --- a/lib/vban.ps1 +++ b/lib/vban.ps1 @@ -4,8 +4,9 @@ class Vban { [Array]$stringparams # Constructor - Vban() + Vban($id) { + $this.id = $id $this.stringparams = @('name', 'ip') } @@ -170,9 +171,8 @@ class Vban { class VbanInstream : Vban { # Constructor - VbanInstream ($id) + VbanInstream ([int]$id) : base ($id) { - $this.id = $id $this.direction = "in" } } @@ -180,9 +180,8 @@ class VbanInstream : Vban { class VbanOutstream : Vban { # Constructor - VbanOutstream ($id) + VbanOutstream ([int]$id) : base ($id) { - $this.id = $id $this.direction = "out" } } @@ -198,9 +197,8 @@ Function Vban { [void]$outstream.Add([VbanOutstream]::new($_)) } - $obj = [PSCustomObject]@{ + [PSCustomObject]@{ instream = $instream outstream = $outstream } - return $obj }