Sha256: a32ef2ca91c9539837a26383fd6ebcaaf722d7fef8a7b77f8c4d42a64ef98d25

Contents?: true

Size: 256 Bytes

Versions: 1

Compression:

Stored size: 256 Bytes

Contents

require 'time'

class String
  TIME = /\d{2}:\d{2}:\d{2},\d{3}/

  def shift_times(delay)
    gsub(TIME) do |time|
      new_time = Time.parse(time) + delay
      new_time.strftime '%H:%M:%S,%3N'
    end
  end

  def timeline?
    /-->/ === self
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
subshift-0.0.1.pre lib/patches/string.rb