class Rugged::OdbObject
Public Instance Methods
data → buffer
click to toggle source
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à <tanoku@gmail.com> 1326863045 -0800\n" #=> ...
static VALUE rb_git_odbobj_data(VALUE self) { git_odb_object *obj; TypedData_Get_Struct(self, git_odb_object, &rugged_odb_object_type, obj); return rb_str_new(git_odb_object_data(obj), git_odb_object_size(obj)); }
size → size
click to toggle source
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
static VALUE rb_git_odbobj_size(VALUE self) { git_odb_object *obj; TypedData_Get_Struct(self, git_odb_object, &rugged_odb_object_type, obj); return INT2FIX(git_odb_object_size(obj)); }
oid → hex_oid
click to toggle source
Return the Object
ID (a 40 character SHA1 hash) for this raw object.
odb_obj.oid #=> "d8786bfc97485e8d7b19b21fb88c8ef1f199fc3f"
static VALUE rb_git_odbobj_oid(VALUE self) { git_odb_object *obj; TypedData_Get_Struct(self, git_odb_object, &rugged_odb_object_type, obj); return rugged_create_oid(git_odb_object_id(obj)); }
type → Symbol
click to toggle source
Return a Ruby symbol representing the basic Git type of this object. Possible values are :tree
, :blob
, :commit
and :tag
.
odb_obj.type #=> :tag
static VALUE rb_git_odbobj_type(VALUE self) { git_odb_object *obj; TypedData_Get_Struct(self, git_odb_object, &rugged_odb_object_type, obj); return rugged_otype_new(git_odb_object_type(obj)); }