Module: StringUtilityBelt::General
- Included in:
- String
- Defined in:
- lib/string_utility_belt/general.rb
Defined Under Namespace
Classes: GENERAL
Constant Summary collapse
- WORD_PATTERN =
/\w[\w\'\-]*/- ANY_SPACE_PATTERN =
/\s+/- SIMPLE_SPACE =
" "
Instance Method Summary collapse
- #have_this_words?(words_to_match, options = nil) ⇒ Boolean
- #not_have_this_words?(words_to_match, options = nil) ⇒ Boolean
- #simple_space ⇒ Object
- #simple_space! ⇒ Object
- #words ⇒ Object
Instance Method Details
#have_this_words?(words_to_match, options = nil) ⇒ Boolean
65 66 67 68 |
# File 'lib/string_utility_belt/general.rb', line 65 def have_this_words?(words_to_match, = nil) i = GENERAL.new(self) i.have_this_words?(words_to_match, ) end |
#not_have_this_words?(words_to_match, options = nil) ⇒ Boolean
70 71 72 73 |
# File 'lib/string_utility_belt/general.rb', line 70 def not_have_this_words?(words_to_match, = nil) i = GENERAL.new(self) !i.have_this_words?(words_to_match, ) end |
#simple_space ⇒ Object
57 58 59 |
# File 'lib/string_utility_belt/general.rb', line 57 def simple_space self.gsub(ANY_SPACE_PATTERN, SIMPLE_SPACE) end |
#simple_space! ⇒ Object
61 62 63 |
# File 'lib/string_utility_belt/general.rb', line 61 def simple_space! self.gsub!(ANY_SPACE_PATTERN, SIMPLE_SPACE) end |
#words ⇒ Object
53 54 55 |
# File 'lib/string_utility_belt/general.rb', line 53 def words self.scan(WORD_PATTERN) end |