Class: Flexite::Diff::ShowService

Inherits:
Object
  • Object
show all
Defined in:
app/services/flexite/diff/show_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(file_name) ⇒ ShowService

Returns a new instance of ShowService.



4
5
6
# File 'app/services/flexite/diff/show_service.rb', line 4

def initialize(file_name)
  @file_name = file_name
end

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
# File 'app/services/flexite/diff/show_service.rb', line 8

def call
  @data = { file_name: @file_name}
  if File.exists?("#{Rails.root}/config/diffs/#{@file_name}")
    @data = { diffs: YAML.load_file("#{Rails.root}/config/diffs/#{@file_name}") }
  end

  Flexite::ActionService::Result.new(data: @data)
end