module Sashite::CGN::NegativeInteger

Constants

PATTERN

Public Class Methods

dump(io) click to toggle source
# File lib/sashite/cgn/negative_integer.rb, line 22
def self.dump io
  raise ArgumentError unless dumpable? io

  io.to_s
end
dumpable?(io) click to toggle source
# File lib/sashite/cgn/negative_integer.rb, line 18
def self.dumpable? io
  loadable? io.to_s
end
load(io) click to toggle source
# File lib/sashite/cgn/negative_integer.rb, line 12
def self.load io
  raise ArgumentError unless loadable? io

  io.to_i
end
loadable?(io) click to toggle source
# File lib/sashite/cgn/negative_integer.rb, line 8
def self.loadable? io
  !!io.match("^#{PATTERN}$")
end