Class: Izokatu::FileExporter
- Defined in:
- lib/izokatu/exporter/file_exporter.rb
Overview
Izokatu exporter for exporting data in some file
Constant Summary
Constants included from Helpers
Helpers::EC_CIPHER, Helpers::KEY_SYMBOL, Helpers::RBNACL_KEY_CLASSES
Instance Attribute Summary collapse
-
#filename ⇒ String
readonly
Name of file to export.
Attributes inherited from Exporter
Instance Method Summary collapse
-
#initialize(data:, filename:, encode:) ⇒ FileExporter
constructor
Initializing data for file export.
-
#perform ⇒ Object
Performing export of initialized data.
Methods included from Callable
Methods included from Helpers
#decode_data, #encode_data, #export_data, #export_decrypted!, #export_encrypted!, #generate_ec_keypair, #generate_rbnacl_keypair, #generate_rsa_keypair, #import_data, #import_encrypted!, #import_encrypted_in_options!
Constructor Details
#initialize(data:, filename:, encode:) ⇒ FileExporter
Initializing data for file export
17 18 19 20 |
# File 'lib/izokatu/exporter/file_exporter.rb', line 17 def initialize(data:, filename:, encode:) super(data: data, encode: encode) @filename = filename end |
Instance Attribute Details
#filename ⇒ String (readonly)
Returns name of file to export.
7 8 9 |
# File 'lib/izokatu/exporter/file_exporter.rb', line 7 def filename @filename end |
Instance Method Details
#perform ⇒ Object
Performing export of initialized data
26 27 28 29 |
# File 'lib/izokatu/exporter/file_exporter.rb', line 26 def perform File.write(filename, JSON.generate(data)) nil end |