class PG::Coder
def ==(v)
def ==(v) self.class == v.class && to_h == v.to_h end
def dup
def dup self.class.new(**to_h) end
def initialize(hash=nil, **kwargs)
def initialize(hash=nil, **kwargs) warn("PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}", category: :deprecated) if hash (hash || kwargs).each do |key, val| send("#{key}=", val) end end
def inspect
def inspect str = self.to_s oid_str = " oid=#{oid}" unless oid==0 format_str = " format=#{format}" unless format==0 name_str = " #{name.inspect}" if name str[-1,0] = "#{name_str} #{oid_str}#{format_str}" str end
def inspect_short
def inspect_short str = case format when 0 then "T" when 1 then "B" else format.to_s end str += "E" if respond_to?(:encode) str += "D" if respond_to?(:decode) "#{name || self.class.name}:#{str}" end
def marshal_dump
def marshal_dump Marshal.dump(to_h) end
def marshal_load(str)
def marshal_load(str) initialize(**Marshal.load(str)) end
def to_h
def to_h { oid: oid, format: format, flags: flags, name: name, } end