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