Class: JVMArgs::Directive
- Inherits:
-
Object
- Object
- JVMArgs::Directive
- Defined in:
- lib/jvmargs/directive.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) ⇒ Directive
constructor
A new instance of Directive.
- #to_s ⇒ Object
Constructor Details
#initialize(arg) ⇒ Directive
Returns a new instance of Directive.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/jvmargs/directive.rb', line 7 def initialize(arg) stripped = arg.sub(/^-?D?/, '') if stripped =~ /(.*?)=(.*)/ @key = $1 @value = $2 else @key = stripped @value = true end end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
5 6 7 |
# File 'lib/jvmargs/directive.rb', line 5 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/jvmargs/directive.rb', line 5 def value @value end |
Instance Method Details
#to_s ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/jvmargs/directive.rb', line 19 def to_s if @value == true "-D#{@key}" else "-D#{@key}=#{@value}" end end |