Class: Dolt::Git::Tree
- Inherits:
-
Object
- Object
- Dolt::Git::Tree
- Includes:
- Enumerable
- Defined in:
- lib/libdolt/git/tree.rb
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#oid ⇒ Object
readonly
Returns the value of attribute oid.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(oid, entries) ⇒ Tree
constructor
A new instance of Tree.
-
#inspect ⇒ Object
From Rugged::Tree.
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
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
22 23 24 |
# File 'lib/libdolt/git/tree.rb', line 22 def entries @entries end |
#oid ⇒ Object (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 |
#inspect ⇒ Object
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 |