Class: PG::Coder

### Home Classes Methods

### In Files

- lib/pg/coder.rb

### Parent

Object

### Namespace

- MODULE PG::Coder::BinaryFormatting

### Methods

- ::new
- #==
- #dup
- #inspect
- #marshal_dump
- #marshal_load
- #to_h

### Files

- LICENSE
- Manifest.txt
- POSTGRES
- README-OS_X.rdoc
- README-Windows.rdoc
- README.ja.rdoc
- README.rdoc
- errorcodes.txt

### Class/Module Index

Quicksearch

- PG
- PG::BasicTypeMapBasedOnResult
- PG::BasicTypeMapForQueries
- PG::BasicTypeMapForResults
- PG::BasicTypeMapForResults::WarningTypeMap
- PG::BasicTypeRegistry
- PG::BasicTypeRegistry::CoderMap
- PG::Coder
- PG::Coder::BinaryFormatting
- PG::CompositeCoder
- PG::Connection
- PG::Connection
- PG::Constants
- PG::CopyCoder
- PG::Error
- PG::NotAllCopyDataRetrieved
- PG::Result
- PG::Result
- PG::TextDecoder
- PG::TextDecoder::Date
- PG::TextDecoder::TimestampWithTimeZone
- PG::TextDecoder::TimestampWithoutTimeZone
- PG::TextEncoder
- PG::TextEncoder::Date
- PG::TextEncoder::TimestampWithTimeZone
- PG::TextEncoder::TimestampWithoutTimeZone
- PG::TypeMapByColumn
- Object
- Object::PGconn
- Object::PGresult

No matching classes.

# PG::Coder

### Public Class Methods

new(params={}) click to toggle source

Create a new coder object based on the attribute Hash.

    # File lib/pg/coder.rb, line 16
    def initialize(params={})
            params.each do |key, val|
                    send("#{key}=", val)
            end
    end

### Public Instance Methods

==(v) click to toggle source

    # File lib/pg/coder.rb, line 35
    def ==(v)
            self.class == v.class && to_h == v.to_h
    end

dup() click to toggle source

    # File lib/pg/coder.rb, line 22
    def dup
            self.class.new(to_h)
    end

inspect() click to toggle source

    # File lib/pg/coder.rb, line 47
    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

marshal_dump() click to toggle source

    # File lib/pg/coder.rb, line 39
    def marshal_dump
            Marshal.dump(to_h)
    end

marshal_load(str) click to toggle source

    # File lib/pg/coder.rb, line 43
    def marshal_load(str)
            initialize Marshal.load(str)
    end

to_h() click to toggle source

Returns coder attributes as Hash.

    # File lib/pg/coder.rb, line 27
    def to_h
            {
                    oid: oid,
                    format: format,
                    name: name,
            }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.