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



337
338
339
340
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 337

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

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines



335
336
337
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 335

def lines
  @lines
end

#revisionsObject (readonly)

Returns the value of attribute revisions



335
336
337
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 335

def revisions
  @revisions
end

Instance Method Details

#add_line(line, revision) ⇒ Object



342
343
344
345
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 342

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

#contentObject



347
348
349
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 347

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

#empty?Boolean

Returns:

  • (Boolean)


351
352
353
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 351

def empty?
  lines.empty?
end