Class: Objc2swiftAssistant::ObjC2SwiftClassLikeConverter
- Inherits:
-
ObjC2SwiftCodeConverter
- Object
- FailableProcessingElement
- ObjC2SwiftCodeConverter
- Objc2swiftAssistant::ObjC2SwiftClassLikeConverter
- Defined in:
- lib/objc2swift_assistant/objc_2_swift.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#implementation_region ⇒ Object
Returns the value of attribute implementation_region.
-
#interface_region ⇒ Object
Returns the value of attribute interface_region.
-
#methods_by_signature ⇒ Object
Returns the value of attribute methods_by_signature.
-
#properties_by_name ⇒ Object
Returns the value of attribute properties_by_name.
Attributes inherited from ObjC2SwiftCodeConverter
#configuration, #file_converter, #marks
Attributes inherited from FailableProcessingElement
Instance Method Summary collapse
-
#has_errors(or_warnings) ⇒ Object
Error Handling.
-
#initialize(file_converter, class_name, configuration) ⇒ ObjC2SwiftClassLikeConverter
constructor
A new instance of ObjC2SwiftClassLikeConverter.
- #method_for_signature(method_signature) ⇒ Object
-
#process_new_property_converter(property_converter) ⇒ Object
Hook for subclasses.
- #property_for_name(property_name) ⇒ Object
Methods inherited from ObjC2SwiftCodeConverter
#add_mark_region, #cannonical_source_file_path, #company_name, #emit_original_bodies, #emit_original_signatures, #emit_unconverted_content, #omit_file
Methods inherited from FailableProcessingElement
#add_error, #add_warning, #initiailize
Constructor Details
#initialize(file_converter, class_name, configuration) ⇒ ObjC2SwiftClassLikeConverter
Returns a new instance of ObjC2SwiftClassLikeConverter.
308 309 310 311 312 313 |
# File 'lib/objc2swift_assistant/objc_2_swift.rb', line 308 def initialize( file_converter, class_name, configuration ) super( file_converter, configuration ) @class_name = class_name @methods_by_signature = {} @properties_by_name = {} end |
Instance Attribute Details
#implementation_region ⇒ Object
Returns the value of attribute implementation_region.
306 307 308 |
# File 'lib/objc2swift_assistant/objc_2_swift.rb', line 306 def implementation_region @implementation_region end |
#interface_region ⇒ Object
Returns the value of attribute interface_region.
305 306 307 |
# File 'lib/objc2swift_assistant/objc_2_swift.rb', line 305 def interface_region @interface_region end |
#methods_by_signature ⇒ Object
Returns the value of attribute methods_by_signature.
303 304 305 |
# File 'lib/objc2swift_assistant/objc_2_swift.rb', line 303 def methods_by_signature @methods_by_signature end |
#properties_by_name ⇒ Object
Returns the value of attribute properties_by_name.
304 305 306 |
# File 'lib/objc2swift_assistant/objc_2_swift.rb', line 304 def properties_by_name @properties_by_name end |
Instance Method Details
#has_errors(or_warnings) ⇒ Object
Error Handling
339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/objc2swift_assistant/objc_2_swift.rb', line 339 def has_errors( or_warnings ) has_em = super.has_errors( or_warnings ) has_em |= @interface_region.has_errors( or_warnings ) unless @interface_region.nil? has_em |= @implementation_region.has_errors( or_warnings ) unless @implementation_region.nil? has_em |= dictionary_has_errors( @methods_by_signature, or_warnings ) has_em |= dictionary_has_errors( @properties_by_name, or_warnings ) has_em end |
#method_for_signature(method_signature) ⇒ Object
315 316 317 318 319 320 321 322 |
# File 'lib/objc2swift_assistant/objc_2_swift.rb', line 315 def method_for_signature( method_signature ) method_converter = @methods_by_signature[ method_signature] if method_converter.nil? method_converter = ObjC2SwiftMethodConverter.new( self, method_signature, @configuration ) @methods_by_signature[ method_signature ] = method_converter end method_converter end |
#process_new_property_converter(property_converter) ⇒ Object
Hook for subclasses
334 335 |
# File 'lib/objc2swift_assistant/objc_2_swift.rb', line 334 def process_new_property_converter( property_converter ) end |
#property_for_name(property_name) ⇒ Object
324 325 326 327 328 329 330 331 |
# File 'lib/objc2swift_assistant/objc_2_swift.rb', line 324 def property_for_name( property_name ) property_converter = @properties_by_name[ property_name] if property_converter.nil? property_converter = ObjC2SwiftPropertyConverter.new( self, property_name, @configuration ) @properties_by_name[ property_name ] = property_converter end property_converter end |