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.



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

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.



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

def name
  @name
end

#widthObject (readonly)

Returns the value of attribute width.



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

def width
  @width
end

Instance Method Details

#value(data) ⇒ Object

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



74
75
76
# File 'lib/innodb/data_type.rb', line 74

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