Class: Ext4::Extent
- Inherits:
-
Object
- Object
- Ext4::Extent
- Defined in:
- lib/fs/ext4/extent.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(buf) ⇒ Extent
constructor
A new instance of Extent.
Constructor Details
#initialize(buf) ⇒ Extent
Returns a new instance of Extent.
18 19 20 21 22 23 24 25 |
# File 'lib/fs/ext4/extent.rb', line 18 def initialize(buf) raise "Ext4::Extent.initialize: Nil buffer" if buf.nil? @extent = EXTENT.decode(buf) @block = @extent['block'] @length = @extent['length'] @start = (@extent['start_hi'] << 32) | @extent['start_lo'] end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
16 17 18 |
# File 'lib/fs/ext4/extent.rb', line 16 def block @block end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
16 17 18 |
# File 'lib/fs/ext4/extent.rb', line 16 def length @length end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
16 17 18 |
# File 'lib/fs/ext4/extent.rb', line 16 def start @start end |
Instance Method Details
#dump ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/fs/ext4/extent.rb', line 27 def dump out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n" out += "Block : #{@block}\n" out += "Length : #{@length}\n" out += "Start : #{@start}\n" out end |