Class: Objc2swiftAssistant::ObjCBlockParameter

Inherits:
ObjCAbstractParameter show all
Defined in:
lib/objc2swift_assistant/objc_variable_types.rb

Instance Attribute Summary collapse

Attributes inherited from ObjCAbstractParameter

#is_block_type, #is_weak, #match_failure, #param_type, #pointer_level

Instance Method Summary collapse

Methods inherited from ObjCAbstractParameter

#initialize, #match_failed, #process_pointer_str

Constructor Details

This class inherits a constructor from Objc2swiftAssistant::ObjCAbstractParameter

Instance Attribute Details

#null_qualifierObject

Returns the value of attribute null_qualifier.



59
60
61
# File 'lib/objc2swift_assistant/objc_variable_types.rb', line 59

def null_qualifier
  @null_qualifier
end

#param_nameObject

Returns the value of attribute param_name.



58
59
60
# File 'lib/objc2swift_assistant/objc_variable_types.rb', line 58

def param_name
  @param_name
end

Instance Method Details

#from_declaration(declaration_str) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/objc2swift_assistant/objc_variable_types.rb', line 61

def from_declaration( declaration_str )
  # TODO: nillabel qulaifiers
  m = declaration_str.match( /^(?<type>\w*)\s*(?<pointer_values>[\*&]*)?\s*(?<name>\w*)/ )
  if m.nil?
    match_failure = "Could not parse block agument: #{declaration_str }"
  else
    process_pointer_str( m[ 'pointer_values' ] )
    @is_block_type = false
    @param_type = m[ 'type' ]
    @param_name = m[ 'name' ]
  end
end