Class: Gitrb::Blob
Overview
This class stores the raw string data of a blob
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#mode ⇒ Object
Returns the value of attribute mode.
Attributes inherited from GitObject
Instance Method Summary collapse
- #==(other) ⇒ Object
- #dump ⇒ Object
-
#initialize(options = {}) ⇒ Blob
constructor
Initialize a Blob.
-
#save ⇒ Object
Save the data to the git object repository.
- #type ⇒ Object
Methods inherited from GitObject
Constructor Details
#initialize(options = {}) ⇒ Blob
Initialize a Blob
9 10 11 12 13 |
# File 'lib/gitrb/blob.rb', line 9 def initialize( = {}) super() @data = [:data] @mode = [:mode] || 0100644 end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
6 7 8 |
# File 'lib/gitrb/blob.rb', line 6 def data @data end |
#mode ⇒ Object
Returns the value of attribute mode.
6 7 8 |
# File 'lib/gitrb/blob.rb', line 6 def mode @mode end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/gitrb/blob.rb', line 19 def ==(other) Blob === other && id == other.id end |
#dump ⇒ Object
23 24 25 |
# File 'lib/gitrb/blob.rb', line 23 def dump @data end |
#save ⇒ Object
Save the data to the git object repository
28 29 30 31 |
# File 'lib/gitrb/blob.rb', line 28 def save repository.put(self) id end |
#type ⇒ Object
15 16 17 |
# File 'lib/gitrb/blob.rb', line 15 def type :blob end |