Class: Redmine::Scm::Adapters::Annotate

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine/scm/adapters/abstract_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAnnotate

Returns a new instance of Annotate.



416
417
418
419
420
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 416

def initialize
  @lines = []
  @revisions = []
  @previous_annotations = []
end

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



414
415
416
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 414

def lines
  @lines
end

#previous_annotationsObject (readonly)

Returns the value of attribute previous_annotations.



414
415
416
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 414

def previous_annotations
  @previous_annotations
end

#revisionsObject (readonly)

Returns the value of attribute revisions.



414
415
416
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 414

def revisions
  @revisions
end

Instance Method Details

#add_line(line, revision, previous = nil) ⇒ Object



422
423
424
425
426
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 422

def add_line(line, revision, previous=nil)
  @lines << line
  @revisions << revision
  @previous_annotations << previous
end

#contentObject



428
429
430
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 428

def content
  content = lines.join("\n")
end

#empty?Boolean

Returns:

  • (Boolean)


432
433
434
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 432

def empty?
  lines.empty?
end