Class: DB::MariaDB::Native::Types::Integer

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

Overview

An integer type converter.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = "INTEGER") ⇒ Integer

Initialize an integer type converter.



37
38
39
# File 'lib/db/mariadb/native/types.rb', line 37

def initialize(name = "INTEGER")
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



42
43
44
# File 'lib/db/mariadb/native/types.rb', line 42

def name
  @name
end

#The SQL type name.(SQLtypename.) ⇒ Object (readonly)



42
# File 'lib/db/mariadb/native/types.rb', line 42

attr :name

Instance Method Details

#parse(string) ⇒ Object

Parse an integer value from the database.



47
48
49
# File 'lib/db/mariadb/native/types.rb', line 47

def parse(string)
  Integer(string) if string
end