Module: StringExtention

Defined in:
lib/gestopft/core_ext/string.rb

Instance Method Summary collapse

Instance Method Details

#option?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/gestopft/core_ext/string.rb', line 4

def option?
	/^--[-a-zA-Z0-9]+$/ === self
end

#to_optionObject



8
9
10
# File 'lib/gestopft/core_ext/string.rb', line 8

def to_option
	(slice(0..2) == '--' ? '' : '--') + strip.gsub('_', '-')
end