Class: SimpleGit::Object

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_git/object.rb

Defined Under Namespace

Classes: ObjectWrapper

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ptrObject

Returns the value of attribute ptr.



3
4
5
# File 'lib/simple_git/object.rb', line 3

def ptr
  @ptr
end

Instance Method Details

#from_wrapper(wrapper) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/simple_git/object.rb', line 5

def from_wrapper(wrapper)
  @ptr = wrapper[:object]

  ObjectSpace.define_finalizer(self, self.class.finalize(@ptr))

  self
end

#to_sObject



13
14
15
16
17
# File 'lib/simple_git/object.rb', line 13

def to_s
  oid = Oid.allocate
  oid.ptr = Git2::GitOid.new(Git2.git_object_id(@ptr))
  oid.to_s
end