Class: SqlPostgres::PgWrapper

Inherits:
PgType
  • Object
show all
Defined in:
lib/sqlpostgres/PgWrapper.rb

Overview

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).

Direct Known Subclasses

PgCidr, PgInet, PgMacAddr

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PgType

#eql?, #hash, #to_sql

Constructor Details

#initialize(value) ⇒ PgWrapper

Returns a new instance of PgWrapper.



19
20
21
# File 'lib/sqlpostgres/PgWrapper.rb', line 19

def initialize(value)
  @value = value
end

Class Method Details

.from_sql(sql) ⇒ Object



13
14
15
# File 'lib/sqlpostgres/PgWrapper.rb', line 13

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

Instance Method Details

#to_sObject



23
24
25
# File 'lib/sqlpostgres/PgWrapper.rb', line 23

def to_s
  @value
end