Class: GitObjectBrowser::Models::IndexReucExtension

Inherits:
Bindata
  • Object
show all
Defined in:
lib/git-object-browser/models/index_reuc_extension.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Bindata

#binstr, #byte, #bytes, #find_char, #hex, #int, #peek, #raw, #seek, #skip, #switch_source

Constructor Details

#initialize(input) ⇒ IndexReucExtension

Returns a new instance of IndexReucExtension.



9
10
11
# File 'lib/git-object-browser/models/index_reuc_extension.rb', line 9

def initialize(input)
  super(input)
end

Instance Attribute Details

#signatureObject (readonly)

Returns the value of attribute signature.



7
8
9
# File 'lib/git-object-browser/models/index_reuc_extension.rb', line 7

def signature
  @signature
end

#total_lengthObject (readonly)

Returns the value of attribute total_length.



7
8
9
# File 'lib/git-object-browser/models/index_reuc_extension.rb', line 7

def total_length
  @total_length
end

Instance Method Details

#parseObject



13
14
15
16
17
18
19
20
# File 'lib/git-object-browser/models/index_reuc_extension.rb', line 13

def parse
  @signature = raw(4) # REUC
  @total_length = int

  data = raw(@total_length) # TODO

  self
end

#to_hashObject



22
23
24
25
26
27
# File 'lib/git-object-browser/models/index_reuc_extension.rb', line 22

def to_hash
  return {
    :signature     => @signature,
    :total_length  => @total_length,
  }
end