Class: DB::Postgres::Native::Types::Decimal

Inherits:
Object
  • Object
show all
Defined in:
lib/db/postgres/native/types.rb

Overview

A decimal type converter.

Instance Method Summary collapse

Instance Method Details

#nameObject

Get the SQL type name for decimal.



72
73
74
# File 'lib/db/postgres/native/types.rb', line 72

def name
  "DECIMAL"
end

#parse(string) ⇒ Object

Parse a decimal value from the database.



79
80
81
# File 'lib/db/postgres/native/types.rb', line 79

def parse(string)
  BigDecimal(string) if string
end