Class: Cryptosphere::Tree
Defined Under Namespace
Classes: Entry
Constant Summary
Constants inherited from Blob
Instance Attribute Summary
Attributes inherited from Blob
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(entries) ⇒ Tree
constructor
A new instance of Tree.
- #to_s ⇒ Object
Methods inherited from Blob
Constructor Details
#initialize(entries) ⇒ Tree
Returns a new instance of Tree.
7 8 9 |
# File 'lib/cryptosphere/blobs/tree.rb', line 7 def initialize(entries) @entries = entries end |
Class Method Details
.[](*entries) ⇒ Object
3 4 5 |
# File 'lib/cryptosphere/blobs/tree.rb', line 3 def self.[](*entries) new(entries) end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/cryptosphere/blobs/tree.rb', line 11 def to_s @entries.sort_by { |e| e.name }.map(&:to_s).join("\n") end |