Module: KissShot::ObjC::Macro

Includes:
Base
Included in:
All
Defined in:
lib/kiss_shot/objc/macro.rb

Instance Method Summary collapse

Methods included from Base

#_objc_bracket_array, #_objc_diamond_array

Instance Method Details

#objc_block_commentObject

Add /**/ comment

Returns:

  • self



15
16
17
18
19
20
21
# File 'lib/kiss_shot/objc/macro.rb', line 15

def objc_block_comment
  line "/*"
  push_line_prefix " *  "
  yield if block_given?
  pop_line_prefix  " *  "
  line " */"
end

#objc_comment(input) ⇒ Object

Add // comment

Parameters:

  • input (String)

    comment

Returns:

  • self



9
10
11
# File 'lib/kiss_shot/objc/macro.rb', line 9

def objc_comment(input)
  line "//  #{input}"
end

#objc_import(input) ⇒ Object

For ‘#import ???`

Parameters:

  • input (String)

    header to import

Returns:

  • self



40
41
42
# File 'lib/kiss_shot/objc/macro.rb', line 40

def objc_import(input)
  line "#import #{input}"
end

#objc_import_d(input) ⇒ Object

For ‘#import <???>`, d is for diamond

Parameters:

  • input (String)

    things in ‘#import <???>`

Returns:

  • self



26
27
28
# File 'lib/kiss_shot/objc/macro.rb', line 26

def objc_import_d(input)
  objc_import "<#{input}>"
end

#objc_import_q(input) ⇒ Object

For ‘#import “???”`, q is for quotes

Parameters:

  • input (String)

    header to import

Returns:

  • self



33
34
35
# File 'lib/kiss_shot/objc/macro.rb', line 33

def objc_import_q(input)
  objc_import "\"#{input}\""
end