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)

Returns:

  • (Numeric, Nil)

    the current value of column



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

Returns:

  • (String)

    the current value of commit_id_new



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

Returns:

  • (String)

    the current value of commit_id_old



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

Returns:



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

Returns:

  • (String)

    the current value of new_file_path



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

Returns:

  • (String)

    the current value of new_lineno



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

Returns:



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

Returns:

  • (String)

    the current value of old_file_path



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

Returns:

  • (String)

    the current value of old_lineno



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

Returns:

  • (Symbol)

    the current value of type



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

def type
  @type
end