Class: JVMArgs::NonStandard
- Inherits:
-
Object
- Object
- JVMArgs::NonStandard
- Defined in:
- lib/jvmargs/nonstandard.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(arg) ⇒ NonStandard
constructor
A new instance of NonStandard.
- #to_s ⇒ Object
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
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/jvmargs/nonstandard.rb', line 3 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/jvmargs/nonstandard.rb', line 3 def value @value end |
Instance Method Details
#to_s ⇒ Object
21 22 23 |
# File 'lib/jvmargs/nonstandard.rb', line 21 def to_s "-#{@key}#{@value}" end |