Class: Rex::Powershell::Param

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/powershell/param.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, name) ⇒ Param

Returns a new instance of Param.



7
8
9
10
# File 'lib/rex/powershell/param.rb', line 7

def initialize(klass, name)
  @klass = klass.strip
  @name = name.strip.gsub(/\s|,/, '')
end

Instance Attribute Details

#klassObject

Returns the value of attribute klass.



6
7
8
# File 'lib/rex/powershell/param.rb', line 6

def klass
  @klass
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/rex/powershell/param.rb', line 6

def name
  @name
end

Instance Method Details

#to_sString

To String

Returns:

  • (String)

    Powershell param



16
17
18
# File 'lib/rex/powershell/param.rb', line 16

def to_s
  "[#{klass}]$#{name}"
end