Class: Dolt::Git::Tree

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/libdolt/git/tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(oid, entries) ⇒ Tree

Returns a new instance of Tree.



25
26
27
28
# File 'lib/libdolt/git/tree.rb', line 25

def initialize(oid, entries)
  @oid = oid
  @entries = entries
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



22
23
24
# File 'lib/libdolt/git/tree.rb', line 22

def entries
  @entries
end

#oidObject (readonly)

Returns the value of attribute oid.



22
23
24
# File 'lib/libdolt/git/tree.rb', line 22

def oid
  @oid
end

Instance Method Details

#each(&block) ⇒ Object



30
31
32
# File 'lib/libdolt/git/tree.rb', line 30

def each(&block)
  entries.each(&block)
end

#inspectObject

From Rugged::Tree



35
36
37
38
39
# File 'lib/libdolt/git/tree.rb', line 35

def inspect
  data = "#<Dolt::Git::Tree:#{object_id} {oid: #{oid}}>\n"
  self.each { |e| data << "  <\"#{e[:name]}\" #{e[:oid]}>\n" }
  data
end