Class: Innodb::Space::DataFile
- Inherits:
-
Object
- Object
- Innodb::Space::DataFile
- Defined in:
- lib/innodb/space.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(filename, offset) ⇒ DataFile
constructor
A new instance of DataFile.
- #name ⇒ Object
Constructor Details
#initialize(filename, offset) ⇒ DataFile
28 29 30 31 32 |
# File 'lib/innodb/space.rb', line 28 def initialize(filename, offset) @file = File.open(filename) @size = @file.stat.size @offset = offset end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
24 25 26 |
# File 'lib/innodb/space.rb', line 24 def file @file end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
26 27 28 |
# File 'lib/innodb/space.rb', line 26 def offset @offset end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
25 26 27 |
# File 'lib/innodb/space.rb', line 25 def size @size end |
Instance Method Details
#name ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/innodb/space.rb', line 34 def name prefix = "" if File.extname(file.path) == ".ibd" prefix = File.basename(File.dirname(file.path)) + "/" end prefix + File.basename(file.path) end |