Class: Flexite::DiffsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/flexite/diffs_controller.rb

Instance Method Summary collapse

Instance Method Details

#applyObject



10
11
12
# File 'app/controllers/flexite/diffs_controller.rb', line 10

def apply
  render json: ServiceFactory.instance.get(:apply_diff, params[:token], params[:stage], params[:checksum]).call
end

#checkObject



5
6
7
8
# File 'app/controllers/flexite/diffs_controller.rb', line 5

def check
  render json: ServiceFactory.instance.get("#{Flexite.config.diff_approach}_check_diff".to_sym,
                                           params[:tree], params[:token], params[:stage], params[:checksum]).call
end

#getObject



32
33
34
35
# File 'app/controllers/flexite/diffs_controller.rb', line 32

def get
  @result = ServiceFactory.instance.get(:get_diff, params[:stage], params[:url]).call
  render :show
end

#pushObject



14
15
16
17
18
19
20
21
22
# File 'app/controllers/flexite/diffs_controller.rb', line 14

def push
  result = ServiceFactory.instance.get(:push_diff, params[:stage], params[:url]).call

  if result.flash.present?
    service_flash(result)
  end

  service_response(result)
end

#save_diffObject



24
25
26
# File 'app/controllers/flexite/diffs_controller.rb', line 24

def save_diff
  ServiceFactory.instance.get(:save_diff, params[:stage], params[:response]).call
end

#showObject



28
29
30
# File 'app/controllers/flexite/diffs_controller.rb', line 28

def show
  @result = ServiceFactory.instance.get(:show_diff, params[:name]).call
end