Class: String
Instance Method Summary collapse
Instance Method Details
#boolean_switch? ⇒ Boolean
42 43 44 |
# File 'lib/Switches.rb', line 42 def boolean_switch? self =~ /\?$/ end |
#long_switch? ⇒ Boolean
38 39 40 |
# File 'lib/Switches.rb', line 38 def long_switch? (self =~ /^..+$/ && !short_switch?) || self =~ /^..+\?$/ || self =~ /^..+!$/ end |
#short_switch? ⇒ Boolean
34 35 36 |
# File 'lib/Switches.rb', line 34 def short_switch? self =~ /^.$/ || self =~ /^.\?$/ || self =~ /^.\!$/ end |