Class: IOSGen::Generator::Objc::ViewModelFormatter
- Inherits:
-
Object
- Object
- IOSGen::Generator::Objc::ViewModelFormatter
- Defined in:
- lib/ios_gen/generator/objc/view_model_formatter.rb
Overview
Objetive-C ViewModel Formatter
Instance Attribute Summary collapse
-
#actions_header ⇒ Object
readonly
ViewModel Actions.
-
#actions_impl ⇒ Object
readonly
ViewModel Actions.
-
#header_file_name ⇒ Object
readonly
File Names ViewModel.
-
#impl_file_name ⇒ Object
readonly
File Names ViewModel.
-
#interactor_formatter ⇒ Object
readonly
Interactor Formatter.
-
#properties_header ⇒ Object
readonly
ViewModel Porperties.
-
#protocol_delegate ⇒ Object
readonly
ViewModel Protocol.
-
#protocol_file_name ⇒ Object
readonly
Returns the value of attribute protocol_file_name.
-
#protocol_name ⇒ Object
readonly
ViewModel Protocol.
-
#view_model ⇒ Object
ViewModel and Interactors.
Instance Method Summary collapse
- #generate(&block) ⇒ Object
- #generate_test(&block) ⇒ Object
-
#initialize(interactor_formatter = InteractorFormatter.new) ⇒ ViewModelFormatter
constructor
A new instance of ViewModelFormatter.
Constructor Details
#initialize(interactor_formatter = InteractorFormatter.new) ⇒ ViewModelFormatter
Returns a new instance of ViewModelFormatter.
20 21 22 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 20 def initialize(interactor_formatter = InteractorFormatter.new) @interactor_formatter = interactor_formatter end |
Instance Attribute Details
#actions_header ⇒ Object (readonly)
ViewModel Actions
16 17 18 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 16 def actions_header @actions_header end |
#actions_impl ⇒ Object (readonly)
ViewModel Actions
16 17 18 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 16 def actions_impl @actions_impl end |
#header_file_name ⇒ Object (readonly)
File Names ViewModel
9 10 11 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 9 def header_file_name @header_file_name end |
#impl_file_name ⇒ Object (readonly)
File Names ViewModel
9 10 11 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 9 def impl_file_name @impl_file_name end |
#interactor_formatter ⇒ Object (readonly)
Interactor Formatter
18 19 20 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 18 def interactor_formatter @interactor_formatter end |
#properties_header ⇒ Object (readonly)
ViewModel Porperties
14 15 16 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 14 def properties_header @properties_header end |
#protocol_delegate ⇒ Object (readonly)
ViewModel Protocol
12 13 14 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 12 def protocol_delegate @protocol_delegate end |
#protocol_file_name ⇒ Object (readonly)
Returns the value of attribute protocol_file_name.
10 11 12 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 10 def protocol_file_name @protocol_file_name end |
#protocol_name ⇒ Object (readonly)
ViewModel Protocol
12 13 14 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 12 def protocol_name @protocol_name end |
#view_model ⇒ Object
ViewModel and Interactors
7 8 9 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 7 def view_model @view_model end |
Instance Method Details
#generate(&block) ⇒ Object
64 65 66 67 68 69 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 64 def generate(&block) block.call(protocol_file_name, 'templates/objc/ViewModelProtocol.h.erb') block.call(header_file_name, 'templates/objc/ViewModel.h.erb') block.call(impl_file_name, 'templates/objc/ViewModel.m.erb') generate_interactor(&block) end |
#generate_test(&block) ⇒ Object
71 72 73 74 |
# File 'lib/ios_gen/generator/objc/view_model_formatter.rb', line 71 def generate_test(&block) block.call(test_file_name, 'templates/objc/XCTestCase.m.erb') generate_interactor_test(&block) end |