class Izokatu::FileExporter

Izokatu exporter for exporting data in some file

Attributes

filename[R]

@return [String] name of file to export

Public Class Methods

new(data:, filename:, encode:) click to toggle source

Initializing data for file export

@param data (data) @param filename (filename) @param encode [TrueClass || FalseClass] Enable/disable encoding of exported data

@since 0.1.0

Calls superclass method Izokatu::Exporter::new
# File lib/izokatu/exporter/file_exporter.rb, line 17
def initialize(data:, filename:, encode:)
  super(data: data, encode: encode)
  @filename = filename
end

Public Instance Methods

perform() click to toggle source

Performing export of initialized data

@since 0.1.0

# File lib/izokatu/exporter/file_exporter.rb, line 26
def perform
  File.write(filename, JSON.generate(data))
  nil
end