Class: KCommercial::Resources::OCGenerator
- Inherits:
-
Object
- Object
- KCommercial::Resources::OCGenerator
- Defined in:
- lib/KCommercialPipeline/core/resource/objective-c/oc_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #code_model ⇒ Object
- #header_contents ⇒ Object
- #imp_contents ⇒ Object
-
#initialize(file_model, name, keys, resources_status, options) ⇒ OCGenerator
constructor
A new instance of OCGenerator.
Constructor Details
#initialize(file_model, name, keys, resources_status, options) ⇒ OCGenerator
Returns a new instance of OCGenerator.
14 15 16 17 18 19 20 |
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_generator.rb', line 14 def initialize(file_model, name, keys, resources_status, ) @file_model = file_model @name = name @keys = keys @super_module_name = .delete(:super) { :KCSemanticResources } @resources_status = resources_status end |
Class Method Details
.templates_root ⇒ Object
9 10 11 |
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_generator.rb', line 9 def templates_root Pathname(__FILE__).parent.join('templates') end |
Instance Method Details
#code_model ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_generator.rb', line 30 def code_model @code_model ||= begin model = CodeModel.new model.keys = @keys model.super_module_name = @super_module_name model.component_name = @name model.resources_status = @resources_status model end end |
#header_contents ⇒ Object
22 23 24 |
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_generator.rb', line 22 def header_contents ERB.new(File.read(@file_model.header)).result(code_model.get_binding) end |
#imp_contents ⇒ Object
26 27 28 |
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_generator.rb', line 26 def imp_contents ERB.new(File.read(@file_model.implementation)).result(code_model.get_binding) end |