Class: SimpleGit::Oid
- Inherits:
-
Object
- Object
- SimpleGit::Oid
- Defined in:
- lib/simple_git/oid.rb
Instance Attribute Summary collapse
-
#ptr ⇒ Object
Returns the value of attribute ptr.
Instance Method Summary collapse
- #[](*args) ⇒ Object
-
#initialize ⇒ Oid
constructor
A new instance of Oid.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Oid
Returns a new instance of Oid.
5 6 7 |
# File 'lib/simple_git/oid.rb', line 5 def initialize @ptr = Git2::GitOid.new end |
Instance Attribute Details
#ptr ⇒ Object
Returns the value of attribute ptr.
3 4 5 |
# File 'lib/simple_git/oid.rb', line 3 def ptr @ptr end |
Instance Method Details
#[](*args) ⇒ Object
15 16 17 |
# File 'lib/simple_git/oid.rb', line 15 def [](*args) to_s.[](*args) end |
#to_s ⇒ Object
9 10 11 12 13 |
# File 'lib/simple_git/oid.rb', line 9 def to_s string = FFI::MemoryPointer.new(:char, 41) Git2.git_oid_tostr(string, 41, @ptr) string.read_string end |