Module: StringExtention
- Defined in:
- lib/gestopft/core_ext/string.rb
Instance Method Summary collapse
Instance Method Details
#option? ⇒ Boolean
4 5 6 |
# File 'lib/gestopft/core_ext/string.rb', line 4 def option? /^--[-a-zA-Z0-9]+$/ === self end |
#to_option ⇒ Object
8 9 10 |
# File 'lib/gestopft/core_ext/string.rb', line 8 def to_option (slice(0..2) == '--' ? '' : '--') + strip.gsub('_', '-') end |