Class: String
Instance Method Summary collapse
- #split_it(char) ⇒ Object
-
#strip_or_self ⇒ Object
ruby returns nil when nothing is stripped.
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_self ⇒ Object
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 |