Class: DB::MariaDB::Native::Types::Float
- Inherits:
-
Object
- Object
- DB::MariaDB::Native::Types::Float
- Defined in:
- lib/db/mariadb/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.
97 98 99 |
# File 'lib/db/mariadb/native/types.rb', line 97 def initialize(name = "FLOAT") @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
102 103 104 |
# File 'lib/db/mariadb/native/types.rb', line 102 def name @name end |
#The SQL type name.(SQLtypename.) ⇒ Object (readonly)
102 |
# File 'lib/db/mariadb/native/types.rb', line 102 attr :name |
Instance Method Details
#parse(string) ⇒ Object
Parse a float value from the database.
107 108 109 |
# File 'lib/db/mariadb/native/types.rb', line 107 def parse(string) Float(string) if string end |