Class: RJGit::Note

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

Constant Summary collapse

DEFAULT_REF =
"refs/notes/commits"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository, note) ⇒ Note

Returns a new instance of Note.



7
8
9
10
11
12
# File 'lib/note.rb', line 7

def initialize(repository, note)
  @jrepo = RJGit.repository_type(repository)
  @jnote = RJGit.note_type(note)
  @message = @jrepo.open(@jnote.getData()).get_bytes.to_a.pack('c*').force_encoding('UTF-8')
  @annotates = @jnote.to_s[5..44]
end

Instance Attribute Details

#annotatesObject (readonly)

Returns the value of attribute annotates.



4
5
6
# File 'lib/note.rb', line 4

def annotates
  @annotates
end

#jnoteObject (readonly)

Returns the value of attribute jnote.



4
5
6
# File 'lib/note.rb', line 4

def jnote
  @jnote
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/note.rb', line 4

def message
  @message
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/note.rb', line 14

def to_s
  @message
end