Class: Rugged::OdbObject
- Inherits:
-
Object
- Object
- Rugged::OdbObject
- Defined in:
- ext/rugged/rugged_repo.c
Instance Method Summary collapse
-
#data ⇒ Object
Return an ASCII buffer with the raw bytes that form the Git object.
-
#size ⇒ Object
Return the size in bytes of the Git object after decompression.
-
#oid ⇒ Object
Return the Object ID (a 40 character SHA1 hash) for this raw object.
-
#type ⇒ Symbol
Return a Ruby symbol representing the basic Git type of this object.
Instance Method Details
#data ⇒ Object
Return an ASCII buffer with the raw bytes that form the Git object.
odb_obj.data #=> "tree 87ebee8367f9cc5ac04858b3bd5610ca74f04df9\n"
#=> "parent 68d041ee999cb07c6496fbdd4f384095de6ca9e1\n"
#=> "author Vicent Martà <[email protected]> 1326863045 -0800\n"
#=> ...
62 63 64 65 66 67 |
# File 'ext/rugged/rugged_repo.c', line 62
static VALUE rb_git_odbobj_data(VALUE self)
{
git_odb_object *obj;
Data_Get_Struct(self, git_odb_object, obj);
return rb_str_new(git_odb_object_data(obj), git_odb_object_size(obj));
}
|
#size ⇒ Object
Return the size in bytes of the Git object after decompression. This is also the size of the obj.data
buffer.
odb_obj.size #=> 231
78 79 80 81 82 83 |
# File 'ext/rugged/rugged_repo.c', line 78
static VALUE rb_git_odbobj_size(VALUE self)
{
git_odb_object *obj;
Data_Get_Struct(self, git_odb_object, obj);
return INT2FIX(git_odb_object_size(obj));
}
|
#oid ⇒ Object
Return the Object ID (a 40 character SHA1 hash) for this raw object.
odb_obj.oid #=> "d8786bfc97485e8d7b19b21fb88c8ef1f199fc3f"
44 45 46 47 48 49 |
# File 'ext/rugged/rugged_repo.c', line 44
static VALUE rb_git_odbobj_oid(VALUE self)
{
git_odb_object *obj;
Data_Get_Struct(self, git_odb_object, obj);
return rugged_create_oid(git_odb_object_id(obj));
}
|
#type ⇒ Symbol
Return a Ruby symbol representing the basic Git type of this object. Possible values are :tree
, :blob
, :commit
and :tag
.
odb_obj.type #=> :tag
94 95 96 97 98 99 |
# File 'ext/rugged/rugged_repo.c', line 94
static VALUE rb_git_odbobj_type(VALUE self)
{
git_odb_object *obj;
Data_Get_Struct(self, git_odb_object, obj);
return rugged_otype_new(git_odb_object_type(obj));
}
|