Class: String

Inherits:
Object show all
Defined in:
lib/widget_list/string.rb

Instance Method Summary collapse

Instance Method Details

#split_it(char) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/widget_list/string.rb', line 13

def split_it(char)
  tmp = self.split(char)
  if tmp.nil?
    [self]
  else
    tmp
  end
end

#strip_or_selfObject

ruby returns nil when nothing is stripped



4
5
6
7
8
9
10
11
# File 'lib/widget_list/string.rb', line 4

def strip_or_self
  tmp = self.strip!
  if tmp.nil?
    self
  else
    tmp
  end
end