Module: KissShot::ObjC::Base

Included in:
Klass, Macro, Protocol
Defined in:
lib/kiss_shot/objc/base.rb

Instance Method Summary collapse

Instance Method Details

#_objc_bracket_array(array) ⇒ String

Create common (?,?,?) from array, nothing if array is empty

Parameters:

  • array (Array)

    things to create

Returns:

  • (String)

    ‘(?,?,?)` if array not empty



19
20
21
22
23
24
25
# File 'lib/kiss_shot/objc/base.rb', line 19

def _objc_bracket_array(array)
  unless array.empty?
    "(#{array.join(', ')})"
  else
    ""
  end
end

#_objc_diamond_array(array) ⇒ String

Create common <?,?,?> from array, nothing if array is empty

Parameters:

  • array (Array)

    things to create

Returns:

  • (String)

    ‘<?,?,?>` if array not empty



8
9
10
11
12
13
14
# File 'lib/kiss_shot/objc/base.rb', line 8

def _objc_diamond_array(array)
  unless array.empty?
    "<#{array.join(', ')}>"
  else
    ""
  end
end