Class: Svnx::Blame::Entry

Inherits:
Svnx::Base::Entry show all
Includes:
Comparable
Defined in:
lib/svnx/blame/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Svnx::Base::Entry

#attribute_value, #element_text, #initialize, #set_attr_var, #set_attr_vars, #set_elmt_var, #set_elmt_vars, #set_var

Constructor Details

This class inherits a constructor from Svnx::Base::Entry

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



18
19
20
# File 'lib/svnx/blame/entry.rb', line 18

def author
  @author
end

#dateObject (readonly)

Returns the value of attribute date.



19
20
21
# File 'lib/svnx/blame/entry.rb', line 19

def date
  @date
end

#line_numberObject (readonly)

Returns the value of attribute line_number.



16
17
18
# File 'lib/svnx/blame/entry.rb', line 16

def line_number
  @line_number
end

#revisionObject (readonly)

Returns the value of attribute revision.



17
18
19
# File 'lib/svnx/blame/entry.rb', line 17

def revision
  @revision
end

Instance Method Details

#<=>(other) ⇒ Object



35
36
37
# File 'lib/svnx/blame/entry.rb', line 35

def <=> other
  line_number <=> other.line_number
end

#datetimeObject



39
40
41
# File 'lib/svnx/blame/entry.rb', line 39

def datetime
  @dt ||= DateTime.parse date
end

#set_commit_fields(rev, auth, date) ⇒ Object



29
30
31
32
33
# File 'lib/svnx/blame/entry.rb', line 29

def set_commit_fields rev, auth, date
  @commit_revision = rev
  @commit_author   = auth
  @commit_date     = date
end

#set_from_element(elmt) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/svnx/blame/entry.rb', line 21

def set_from_element elmt
  set_attr_var elmt, 'line_number', 'line-number'
  
  commit = elmt.at_xpath 'commit'
  set_attr_var commit, 'revision'
  set_elmt_vars commit, 'author', 'date'
end