summaryrefslogtreecommitdiff
path: root/lib/oxidized/string.rb
blob: b334eaa6ddb62b30d320ba826e287f484e7b7c30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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