Class: Innodb::DataType::FloatType

Inherits:
Object
  • Object
show all
Defined in:
lib/innodb/data_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_type, modifiers, properties) ⇒ FloatType

Returns a new instance of FloatType.



64
65
66
67
# File 'lib/innodb/data_type.rb', line 64

def initialize(base_type, modifiers, properties)
  @width = 4
  @name = Innodb::DataType.make_name(base_type, modifiers, properties)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



62
63
64
# File 'lib/innodb/data_type.rb', line 62

def name
  @name
end

#widthObject (readonly)

Returns the value of attribute width.



62
63
64
# File 'lib/innodb/data_type.rb', line 62

def width
  @width
end

Instance Method Details

#value(data) ⇒ Object

Read a little-endian single-precision floating-point number.



70
71
72
# File 'lib/innodb/data_type.rb', line 70

def value(data)
  BinData::FloatLe.read(data)
end