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
Returns a new instance of DataFile.
44 45 46 47 48 |
# File 'lib/innodb/space.rb', line 44 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.
40 41 42 |
# File 'lib/innodb/space.rb', line 40 def file @file end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
42 43 44 |
# File 'lib/innodb/space.rb', line 42 def offset @offset end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
41 42 43 |
# File 'lib/innodb/space.rb', line 41 def size @size end |
Instance Method Details
#name ⇒ Object
50 51 52 53 54 55 |
# File 'lib/innodb/space.rb', line 50 def name prefix = "" prefix = "#{File.basename(File.dirname(file.path))}/" if File.extname(file.path) == ".ibd" prefix + File.basename(file.path) end |