Class: DB::Postgres::Native::Types::Float
- Inherits:
-
Object
- Object
- DB::Postgres::Native::Types::Float
- Defined in:
- lib/db/postgres/native/types.rb
Overview
A floating point type converter.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
- #The SQL type name.(SQLtypename.) ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(name = "FLOAT") ⇒ Float
constructor
Initialize a float type converter.
-
#parse(string) ⇒ Object
Parse a float value from the database.
Constructor Details
#initialize(name = "FLOAT") ⇒ Float
Initialize a float type converter.
88 89 90 |
# File 'lib/db/postgres/native/types.rb', line 88 def initialize(name = "FLOAT") @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
93 94 95 |
# File 'lib/db/postgres/native/types.rb', line 93 def name @name end |
#The SQL type name.(SQLtypename.) ⇒ Object (readonly)
93 |
# File 'lib/db/postgres/native/types.rb', line 93 attr :name |
Instance Method Details
#parse(string) ⇒ Object
Parse a float value from the database.
98 99 100 |
# File 'lib/db/postgres/native/types.rb', line 98 def parse(string) Float(string) if string end |