Class: VCSToolkit::Objects::Blob
- Defined in:
- lib/vcs_toolkit/objects/blob.rb
Overview
A blob is a nameless object that contains a snapshot of a file’s data. The file name is stored with the reference to this object (in a Tree object).
The id of the blob is by default its content’s hash.
The content is not serialized by default (in Blob.to_hash) because one might decide that content should be handled differently (or in different format).
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Attributes inherited from Object
Instance Method Summary collapse
-
#initialize(content:, id: nil, **context) ⇒ Blob
constructor
A new instance of Blob.
Methods inherited from Object
Methods included from Serializable
Methods included from Utils::HashableObject
Constructor Details
#initialize(content:, id: nil, **context) ⇒ Blob
Returns a new instance of Blob.
26 27 28 29 30 31 32 |
# File 'lib/vcs_toolkit/objects/blob.rb', line 26 def initialize(content:, id: nil, **context) @content = content super id: id, object_type: :blob, **context end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
22 23 24 |
# File 'lib/vcs_toolkit/objects/blob.rb', line 22 def content @content end |