Class: GitDB::Objects::Entry
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#permissions ⇒ Object
readonly
Returns the value of attribute permissions.
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(sha, permissions, name) ⇒ Entry
constructor
A new instance of Entry.
- #properties ⇒ Object
- #to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(sha, permissions, name) ⇒ Entry
Returns a new instance of Entry.
7 8 9 10 11 |
# File 'lib/git-db/objects/entry.rb', line 7 def initialize(sha, , name) @sha = sha @permissions = @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/git-db/objects/entry.rb', line 5 def name @name end |
#permissions ⇒ Object (readonly)
Returns the value of attribute permissions.
5 6 7 |
# File 'lib/git-db/objects/entry.rb', line 5 def @permissions end |
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
5 6 7 |
# File 'lib/git-db/objects/entry.rb', line 5 def sha @sha end |
Instance Method Details
#properties ⇒ Object
13 14 15 |
# File 'lib/git-db/objects/entry.rb', line 13 def properties [:permissions, :name] end |
#to_hash ⇒ Object
17 18 19 |
# File 'lib/git-db/objects/entry.rb', line 17 def to_hash { :sha => sha, :permissions => , :name => name } end |
#to_json ⇒ Object
21 22 23 |
# File 'lib/git-db/objects/entry.rb', line 21 def to_json to_hash.to_json end |