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