Class: KCommercial::Resources::SwiftGenerator
- Inherits:
-
Object
- Object
- KCommercial::Resources::SwiftGenerator
- Defined in:
- lib/KCommercialPipeline/core/resource/swift/swift_generator.rb
Direct Known Subclasses
ColorsGenerator, FilesGenerator, FontsGenerator, I18nsGenerator, ImagesGenerator
Instance Attribute Summary collapse
-
#keys ⇒ Array<String>
readonly
The key defines for the generator.
-
#super_module ⇒ String
readonly
The super module default is MKResources.
Instance Method Summary collapse
- #extension_contents ⇒ Object
-
#initialize(keys, options = {}) ⇒ SwiftGenerator
constructor
Create a new SwiftGenerator.
Constructor Details
#initialize(keys, options = {}) ⇒ SwiftGenerator
Create a new SwiftGenerator
27 28 29 30 31 |
# File 'lib/KCommercialPipeline/core/resource/swift/swift_generator.rb', line 27 def initialize(keys, = {}) @keys = keys @keys ||= [] @super_module = .delete(:super) { :MKResources} end |
Instance Attribute Details
#keys ⇒ Array<String> (readonly)
The key defines for the generator
23 24 25 |
# File 'lib/KCommercialPipeline/core/resource/swift/swift_generator.rb', line 23 def keys @keys end |
#super_module ⇒ String (readonly)
The super module default is MKResources
19 20 21 |
# File 'lib/KCommercialPipeline/core/resource/swift/swift_generator.rb', line 19 def super_module @super_module end |
Instance Method Details
#extension_contents ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/KCommercialPipeline/core/resource/swift/swift_generator.rb', line 33 def extension_contents <<EOF // // SharedResources.swift // MKSharedResources // // Created by Dong Zhao on 2020/12/31. // import MKResources import #{super_module} extension R { #{append_prefix(swift_contents,"\t")} } EOF end |