# File reline/kill_ring.rb, line 68 def append(string, before_p = false) case @state when State::FRESH, State::YANK @ring << RingPoint.new(string) @state = State::CONTINUED when State::CONTINUED, State::PROCESSED if before_p @ring.head.str.prepend(string) else @ring.head.str.concat(string) end @state = State::CONTINUED end end
# File reline/kill_ring.rb, line 116 def each start = head = @ring.head loop do break if head.nil? yield head.str head = head.backward break if head == start end end
# File reline/kill_ring.rb, line 83 def process case @state when State::FRESH # nothing to do when State::CONTINUED @state = State::PROCESSED when State::PROCESSED @state = State::FRESH when State::YANK # nothing to do end end