Class: Izokatu::Exporter Abstract

Inherits:
Object
  • Object
show all
Extended by:
Callable
Includes:
Contracts, Helpers
Defined in:
lib/izokatu/exporter.rb

Overview

This class is abstract.

Subclasses are containing implementation of #perform

Abstract class for exporters

Direct Known Subclasses

FileExporter, FunctionExporter, StdoutExporter

Constant Summary

Constants included from Helpers

Helpers::EC_CIPHER, Helpers::KEY_SYMBOL, Helpers::RBNACL_KEY_CLASSES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Callable

call

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:, encode:) ⇒ Exporter

Initializing data for export

Parameters:

  • data (#data)
  • encode (TrueClass || FalseClass)

    Enable/disable encoding of exported data

Since:

  • 0.1.0



23
24
25
# File 'lib/izokatu/exporter.rb', line 23

def initialize(data:, encode:)
  @data = encode ? encode_data(data) : data
end

Instance Attribute Details

#dataString (readonly)

Returns data for export.

Returns:

  • (String)

    data for export



14
15
16
# File 'lib/izokatu/exporter.rb', line 14

def data
  @data
end

Instance Method Details

#performObject

Performing export of initialized data

Raises:

  • RuntimeError

Since:

  • 0.1.0



32
33
34
# File 'lib/izokatu/exporter.rb', line 32

def perform
  raise 'Not implemented!'
end