Class: KCommercial::Resources::OCFileModel

Inherits:
Object
  • Object
show all
Defined in:
lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(header_name, imp_name) ⇒ OCFileModel

Returns a new instance of OCFileModel.



52
53
54
55
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 52

def initialize(header_name, imp_name)
  @header = OCFileModel.templates_root.join(header_name) if header_name
  @implementation = OCFileModel.templates_root.join(imp_name) if imp_name
end

Instance Attribute Details

#headerObject

Returns the value of attribute header.



5
6
7
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 5

def header
  @header
end

#implementationObject

Returns the value of attribute implementation.



6
7
8
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 6

def implementation
  @implementation
end

Class Method Details

.colors_modelObject



42
43
44
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 42

def colors_model
  file_model_for_type('Colors')
end

.file_model_for_type(type) ⇒ Object



46
47
48
49
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 46

def file_model_for_type(type)
  OCFileModel.new("{{oc_class_name}}+#{type}.h",
                  "{{oc_class_name}}+#{type}.m")
end

.files_modelObject



38
39
40
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 38

def files_model
  file_model_for_type('Files')
end

.fonts_modelObject



30
31
32
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 30

def fonts_model
  file_model_for_type('Fonts')
end

.i18ns_modelObject



26
27
28
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 26

def i18ns_model
  file_model_for_type('I18ns')
end

.images_modelObject



34
35
36
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 34

def images_model
  file_model_for_type('Images')
end

.main_modelObject



21
22
23
24
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 21

def main_model
  OCFileModel.new('{{oc_class_name}}.h',
                  '{{oc_class_name}}.m')
end

.public_headerObject



13
14
15
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 13

def public_header
  templates_root.join('{{component_header_name}}.h')
end

.public_modelObject



17
18
19
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 17

def public_model
  OCFileModel.new('{{component_header_name}}.h', nil)
end

.templates_rootObject



9
10
11
# File 'lib/KCommercialPipeline/core/resource/objective-c/oc_file_model.rb', line 9

def templates_root
  Pathname(__FILE__).parent.join('templates')
end