Class: GitDB::Objects::Base
- Inherits:
-
Object
- Object
- GitDB::Objects::Base
show all
- Defined in:
- lib/git-db/objects/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
5
6
7
|
# File 'lib/git-db/objects/base.rb', line 5
def initialize(data)
@data = data
end
|
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
3
4
5
|
# File 'lib/git-db/objects/base.rb', line 3
def data
@data
end
|
Instance Method Details
#inspect ⇒ Object
9
10
11
|
# File 'lib/git-db/objects/base.rb', line 9
def inspect
%{#<#{self.class} #{inspect_properties}>}
end
|
#properties ⇒ Object
13
14
15
|
# File 'lib/git-db/objects/base.rb', line 13
def properties
[:data]
end
|
#raw ⇒ Object
17
18
19
|
# File 'lib/git-db/objects/base.rb', line 17
def raw
data
end
|
#sha ⇒ Object
21
22
23
|
# File 'lib/git-db/objects/base.rb', line 21
def sha
Digest::SHA1.hexdigest(raw)
end
|