class DeepTest::Option
Attributes
default[R]
name[R]
Public Class Methods
new(name, type, default)
click to toggle source
# File lib/deep_test/option.rb, line 5 def initialize(name, type, default) @name, @type, @default = name, type, default end
Public Instance Methods
from_command_line(command_line)
click to toggle source
# File lib/deep_test/option.rb, line 9 def from_command_line(command_line) command_line =~ /--#{name} (\S+)(\s|$)/ @type.from_string($1) if $1 end
to_command_line(value)
click to toggle source
# File lib/deep_test/option.rb, line 14 def to_command_line(value) "--#{name} #{@type.to_string(value)}" if value && value != default end