Class: ShowDiffJob

Inherits:
Struct
  • Object
show all
Defined in:
app/jobs/show_diff_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_treeObject

Returns the value of attribute current_tree

Returns:

  • (Object)

    the current value of current_tree



1
2
3
# File 'app/jobs/show_diff_job.rb', line 1

def current_tree
  @current_tree
end

#file_nameObject

Returns the value of attribute file_name

Returns:

  • (Object)

    the current value of file_name



1
2
3
# File 'app/jobs/show_diff_job.rb', line 1

def file_name
  @file_name
end

#other_treeObject

Returns the value of attribute other_tree

Returns:

  • (Object)

    the current value of other_tree



1
2
3
# File 'app/jobs/show_diff_job.rb', line 1

def other_tree
  @other_tree
end

Instance Method Details

#beforeObject



2
3
4
# File 'app/jobs/show_diff_job.rb', line 2

def before
  Flexite::JobReport.create(file_name: file_name, status: Flexite::JobReport::STATUS[:in_progress])
end

#errorObject



16
17
18
19
20
# File 'app/jobs/show_diff_job.rb', line 16

def error
  Flexite::JobReport
    .find_by_file_name(file_name)
    .update_attributes(status: Flexite::JobReport::STATUS[:error])
end

#performObject



6
7
8
# File 'app/jobs/show_diff_job.rb', line 6

def perform
  Flexite::Diff::CheckService.new(current_tree, other_tree, file_name).call
end

#successObject



10
11
12
13
14
# File 'app/jobs/show_diff_job.rb', line 10

def success
  Flexite::JobReport
    .find_by_file_name(file_name)
    .update_attributes(status: Flexite::JobReport::STATUS[:done])
end