Class: Ext4::HashTreeHeader
- Inherits:
-
Object
- Object
- Ext4::HashTreeHeader
- Defined in:
- lib/fs/ext4/hash_tree_header.rb
Instance Attribute Summary collapse
-
#hash_version ⇒ Object
readonly
Returns the value of attribute hash_version.
-
#leaf_level ⇒ Object
readonly
Returns the value of attribute leaf_level.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(buf) ⇒ HashTreeHeader
constructor
A new instance of HashTreeHeader.
Constructor Details
#initialize(buf) ⇒ HashTreeHeader
Returns a new instance of HashTreeHeader.
19 20 21 22 23 24 25 26 |
# File 'lib/fs/ext4/hash_tree_header.rb', line 19 def initialize(buf) raise "Ext4::HashTreeHeader.initialize: Nil buffer" if buf.nil? @hth = HASH_TREE_HEADER.decode(buf) @hash_version = @hth['hash_ver'] @length = @hth['length'] @leaf_level = @hth['leaf_level'] end |
Instance Attribute Details
#hash_version ⇒ Object (readonly)
Returns the value of attribute hash_version.
17 18 19 |
# File 'lib/fs/ext4/hash_tree_header.rb', line 17 def hash_version @hash_version end |
#leaf_level ⇒ Object (readonly)
Returns the value of attribute leaf_level.
17 18 19 |
# File 'lib/fs/ext4/hash_tree_header.rb', line 17 def leaf_level @leaf_level end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
17 18 19 |
# File 'lib/fs/ext4/hash_tree_header.rb', line 17 def length @length end |
Instance Method Details
#dump ⇒ Object
28 29 30 31 32 33 |
# File 'lib/fs/ext4/hash_tree_header.rb', line 28 def dump out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n" out += "Hash Version : #{@hash_version}\n" out += "Length : #{@length}\n" out += "Leaf Level : #{@leaf_level}\n" end |