Class: MetaCommit::Contracts::ChangeContext

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

Overview

DTO that keeps data of context of change

Instance Attribute Summary collapse

Instance Attribute Details

#columnNumeric, Nil

position of the first character in the new line that is different from character at the same position in the old line (it has meaning only when type == :replace)



13
14
15
# File 'lib/meta_commit_contracts/change_context.rb', line 13

def column
  @column
end

#commit_id_newString

hash of the new commit



13
14
15
# File 'lib/meta_commit_contracts/change_context.rb', line 13

def commit_id_new
  @commit_id_new
end

#commit_id_oldString

hash of the old commit



13
14
15
# File 'lib/meta_commit_contracts/change_context.rb', line 13

def commit_id_old
  @commit_id_old
end

#new_contextual_astMetaCommit::Contracts::ContextualAst

stores ast and context from the new file



13
14
15
# File 'lib/meta_commit_contracts/change_context.rb', line 13

def new_contextual_ast
  @new_contextual_ast
end

#new_file_pathString

path to new file



13
14
15
# File 'lib/meta_commit_contracts/change_context.rb', line 13

def new_file_path
  @new_file_path
end

#new_linenoString

line number in the new file



13
14
15
# File 'lib/meta_commit_contracts/change_context.rb', line 13

def new_lineno
  @new_lineno
end

#old_contextual_astMetaCommit::Contracts::ContextualAst

stores ast and context from the old file



13
14
15
# File 'lib/meta_commit_contracts/change_context.rb', line 13

def old_contextual_ast
  @old_contextual_ast
end

#old_file_pathString

path to old file



13
14
15
# File 'lib/meta_commit_contracts/change_context.rb', line 13

def old_file_path
  @old_file_path
end

#old_linenoString

line number in the old file



13
14
15
# File 'lib/meta_commit_contracts/change_context.rb', line 13

def old_lineno
  @old_lineno
end

#typeSymbol

operation that was performed :addition, :deletion, :replace



13
14
15
# File 'lib/meta_commit_contracts/change_context.rb', line 13

def type
  @type
end