summaryrefslogtreecommitdiff
path: root/lib/oxidized/string.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/string.rb')
-rw-r--r--lib/oxidized/string.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/oxidized/string.rb b/lib/oxidized/string.rb
new file mode 100644
index 0000000..b334eaa
--- /dev/null
+++ b/lib/oxidized/string.rb
@@ -0,0 +1,13 @@
+module Oxidized
+ # Used in models, contains convenience methods
+ class String < String
+ # @return [Oxidized::String] copy of self with last line removed
+ def pop
+ Oxy::String.new each_line.to_a[0..-2].join
+ end
+ # @return [Oxidized::String] copy of self with first line removed
+ def shift
+ Oxy::String.new each_line.to_a[1..-1].join
+ end
+ end
+end