Class: Objc2swiftAssistant::AtDirectiveRegion
- Inherits:
-
MigrationRegion
- Object
- FailableProcessingElement
- MigrationRegion
- Objc2swiftAssistant::AtDirectiveRegion
- Defined in:
- lib/objc2swift_assistant/recognizers/at_sign_directives_recognizer.rb
Instance Attribute Summary collapse
-
#directive_symbol ⇒ Object
Returns the value of attribute directive_symbol.
Attributes inherited from MigrationRegion
#allowed_parent_region_types, #can_occur_in_class_decl, #configuration, #detection_line, #ending_line_number, #ending_of_root_header, #is_root_entity, #is_single_line, #parent_region, #region_identifier, #region_type, #root_header, #starting_line_number, #sub_regions
Attributes inherited from FailableProcessingElement
Instance Method Summary collapse
- #brief_description ⇒ Object
- #description ⇒ Object
- #extract_information(file_slice) ⇒ Object
-
#initialize(starting_line_number, is_root_entity) ⇒ AtDirectiveRegion
constructor
A new instance of AtDirectiveRegion.
Methods inherited from MigrationRegion
#add_sub_region, #complete, #contains_line, #dump, #dump_region_info, #generic_description, #has_failed, #resolve_ending_line_number
Methods inherited from FailableProcessingElement
#add_error, #add_warning, #has_errors, #initiailize
Constructor Details
#initialize(starting_line_number, is_root_entity) ⇒ AtDirectiveRegion
Returns a new instance of AtDirectiveRegion.
19 20 21 22 23 |
# File 'lib/objc2swift_assistant/recognizers/at_sign_directives_recognizer.rb', line 19 def initialize(starting_line_number, is_root_entity ) super(starting_line_number, is_root_entity, AT_DIRECTIVE_KEY, can_occur_in_class_decl:true ) @is_single_line = true @directive_symbol = nil end |
Instance Attribute Details
#directive_symbol ⇒ Object
Returns the value of attribute directive_symbol.
17 18 19 |
# File 'lib/objc2swift_assistant/recognizers/at_sign_directives_recognizer.rb', line 17 def directive_symbol @directive_symbol end |
Instance Method Details
#brief_description ⇒ Object
32 33 34 |
# File 'lib/objc2swift_assistant/recognizers/at_sign_directives_recognizer.rb', line 32 def brief_description() return "@#{@directive_symbol.to_s}" end |
#description ⇒ Object
36 37 38 |
# File 'lib/objc2swift_assistant/recognizers/at_sign_directives_recognizer.rb', line 36 def description() generic_description( "Objective-C directive @#{@directive_symbol.to_s}" ) end |
#extract_information(file_slice) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/objc2swift_assistant/recognizers/at_sign_directives_recognizer.rb', line 25 def extract_information( file_slice ) m = DIRECTIVE_REGEX.match(file_slice[0]) unless m.nil? @directive_symbol = m[ 'directive' ].to_sym end end |