Class: String
Instance Method Summary collapse
Instance Method Details
#boolean_switch? ⇒ Boolean
33 34 35 |
# File 'lib/Switches.rb', line 33 def boolean_switch? self =~ /\?$/ end |
#long_switch? ⇒ Boolean
29 30 31 |
# File 'lib/Switches.rb', line 29 def long_switch? (self =~ /^..+$/ && !short_switch?) || self =~ /^..+\?$/ || self =~ /^..+!$/ end |
#short_switch? ⇒ Boolean
25 26 27 |
# File 'lib/Switches.rb', line 25 def short_switch? self =~ /^.$/ || self =~ /^.\?$/ || self =~ /^.\!$/ end |