Class: RailsConsolePro::Commands::ExportCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/rails_console_pro/commands/export_command.rb

Instance Method Summary collapse

Methods included from RailsConsolePro::ColorHelper

#bold_color, #color, #method_missing, #pastel, #respond_to_missing?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RailsConsolePro::ColorHelper

Instance Method Details

#execute(data, file_path, format: nil) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/rails_console_pro/commands/export_command.rb', line 6

def execute(data, file_path, format: nil)
  return nil if data.nil?
  
  FormatExporter.export_to_file(data, file_path, format: format)
rescue => e
  RailsConsolePro::ErrorHandler.handle(e, context: :export)
end