Class: JVMArgs::NonStandard

Inherits:
Object
  • Object
show all
Defined in:
lib/jvmargs/nonstandard.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg) ⇒ NonStandard

Returns a new instance of NonStandard.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/jvmargs/nonstandard.rb', line 5

def initialize(arg)
  stripped = arg.sub(/^-/, '')
  stripped =~ /(X[a-z]+:?)([0-9]+[a-zA-Z])?/
  if $2.nil?
    @key = $1 
    @value = stripped[@key.length..-1] # could be an empty string
  else
    @key = $1
    @value = JVMArgs::Util.convert_to_m($2)
    # value is a kilobyte value < 1 MB after conversion
    if @value == "0M"
      @value = JVMArgs::Util.normalize_units($2).join('')
    end
  end
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/jvmargs/nonstandard.rb', line 3

def key
  @key
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/jvmargs/nonstandard.rb', line 3

def value
  @value
end

Instance Method Details

#to_sObject



21
22
23
# File 'lib/jvmargs/nonstandard.rb', line 21

def to_s
  "-#{@key}#{@value}"
end