Class: Flexite::Diff::ShowService
- Inherits:
-
Object
- Object
- Flexite::Diff::ShowService
- Defined in:
- app/services/flexite/diff/show_service.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(file_name) ⇒ ShowService
constructor
A new instance of ShowService.
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
#call ⇒ Object
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 |