Method: Jazzy::SourceKitten.make_objc_declaration
- Defined in:
- lib/jazzy/sourcekitten.rb
.make_objc_declaration(declaration) ⇒ Object
513 514 515 516 517 518 519 520 521 522 523 524 525 |
# File 'lib/jazzy/sourcekitten.rb', line 513 def self.make_objc_declaration(declaration) return declaration if Config.instance.keep_property_attributes declaration =~ /\A@property\s+\((.*?)\)/ return declaration unless Regexp.last_match attrs = Regexp.last_match[1].split(',').map(&:strip) - DEFAULT_ATTRIBUTES attrs_text = attrs.empty? ? '' : " (#{attrs.join(', ')})" declaration .sub(/(?<=@property)\s+\(.*?\)/, attrs_text) .gsub(/\s+/, ' ') end |