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.



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

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

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



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

def lines
  @lines
end

#revisionsObject (readonly)

Returns the value of attribute revisions.



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

def revisions
  @revisions
end

Instance Method Details

#add_line(line, revision) ⇒ Object



420
421
422
423
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 420

def add_line(line, revision)
  @lines << line
  @revisions << revision
end

#contentObject



425
426
427
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 425

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

#empty?Boolean

Returns:

  • (Boolean)


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

def empty?
  lines.empty?
end