Sha256: 81a1ccef8a7e3f3bf09eddae0573fb04abaf2a9e4f84d479f0d42d7e63809545

Contents?: true

Size: 630 Bytes

Versions: 1

Compression:

Stored size: 630 Bytes

Contents

require File.expand_path('PgType', File.dirname(__FILE__))

module SqlPostgres

  # This PgType is the base class of wrapper types that are merely
  # wrappers around String.  Its purpose is to identify the type of
  # String (is it a mac address?  An inet address? etc).

  class PgWrapper < PgType

    class << self

      def from_sql(sql)
        self.new(sql)
      end

    end

    def initialize(value)
      @value = value
    end

    def to_s
      @value
    end

    protected

    def parts
      [@value]
    end

  end

end

# Local Variables:
# tab-width: 2
# ruby-indent-level: 2
# indent-tabs-mode: nil
# End:

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sqlpostgres-1.3.0 lib/sqlpostgres/PgWrapper.rb