Class: Procreate::Swatches::Exporter
- Inherits:
-
Object
- Object
- Procreate::Swatches::Exporter
- Includes:
- CallableClass
- Defined in:
- lib/procreate/swatches/exporter.rb
Overview
The class that handles the export of a Wrapper to a .swatches
file.
Constant Summary collapse
- PERMITTED_OPTIONS =
Permitted options. Any other key will be discarded.
%i[export_directory file_name].freeze
Instance Attribute Summary collapse
-
#options ⇒ Hash
Export options.
-
#swatches_path ⇒ Object
readonly
The computed path of the
.swatches
file, after the file was exported. -
#wrapper ⇒ Object
An instance of Wrapper.
Class Method Summary collapse
-
.call ⇒ Object
Creates a new instance of Exporter and calls #call Dynamically included by using CallableClass gem.
Instance Method Summary collapse
-
#call ⇒ String
(also: #export)
Exports the
.swatches
file. -
#initialize(wrapper, options = {}) ⇒ Exporter
constructor
Initialize a new Exporter.
Constructor Details
#initialize(wrapper, options = {}) ⇒ Exporter
Initialize a new Procreate::Swatches::Exporter
32 33 34 35 |
# File 'lib/procreate/swatches/exporter.rb', line 32 def initialize(wrapper, = {}) @wrapper = wrapper () end |
Instance Attribute Details
#options ⇒ Hash
Export options
51 52 53 |
# File 'lib/procreate/swatches/exporter.rb', line 51 def (@options) end |
#swatches_path ⇒ Object (readonly)
The computed path of the .swatches
file, after the file was exported.
22 23 24 |
# File 'lib/procreate/swatches/exporter.rb', line 22 def swatches_path @swatches_path end |
#wrapper ⇒ Object
An instance of Wrapper
20 21 22 |
# File 'lib/procreate/swatches/exporter.rb', line 20 def wrapper @wrapper end |
Class Method Details
.call ⇒ Object
Creates a new instance of Procreate::Swatches::Exporter and calls #call Dynamically included by using CallableClass gem.
|
# File 'lib/procreate/swatches/exporter.rb', line 15
|
Instance Method Details
#call ⇒ String Also known as: export
Exports the .swatches
file.
40 41 42 43 44 |
# File 'lib/procreate/swatches/exporter.rb', line 40 def call zip_content! swatches_path end |