Class: DB::MariaDB::Native::Types::Float

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

Overview

A floating point type converter.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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