Class: Innodb::DataType::FloatType
- Inherits:
-
Object
- Object
- Innodb::DataType::FloatType
- Defined in:
- lib/innodb/data_type.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(base_type, modifiers, properties) ⇒ FloatType
constructor
A new instance of FloatType.
-
#value(data) ⇒ Object
Read a little-endian single-precision floating-point number.
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
65 66 67 |
# File 'lib/innodb/data_type.rb', line 65 def name @name end |
#width ⇒ Object (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 |