Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/super_strip.rb

Overview

Special version of strip methods to remove special white spaces

Instance Method Summary collapse

Instance Method Details

#super_lstripObject



5
6
7
8
9
# File 'lib/super_strip.rb', line 5

def super_lstrip
  split('').drop_while do |point|
    SuperStrip::WHITE_SPACES.include?(point)
  end.join
end

#super_lstrip!Object



19
20
21
# File 'lib/super_strip.rb', line 19

def super_lstrip!
  do_change(:super_lstrip)
end

#super_rstripObject



11
12
13
# File 'lib/super_strip.rb', line 11

def super_rstrip
  reverse.super_lstrip.reverse
end

#super_rstrip!Object



23
24
25
# File 'lib/super_strip.rb', line 23

def super_rstrip!
  do_change(:super_rstrip)
end

#super_stripObject



15
16
17
# File 'lib/super_strip.rb', line 15

def super_strip
  super_lstrip.super_rstrip
end

#super_strip!Object



27
28
29
# File 'lib/super_strip.rb', line 27

def super_strip!
  do_change(:super_strip)
end