Class: Nidyx::ObjCImplementation

Inherits:
ObjCModelBase show all
Defined in:
lib/nidyx/objc/implementation.rb

Instance Attribute Summary collapse

Attributes inherited from ObjCModelBase

#author, #class_forward_declarations, #comments, #file_name, #imports, #json_model, #name, #owner, #project, #protocol_declarations, #protocol_forward_declarations

Instance Method Summary collapse

Methods inherited from ObjCModelBase

#has_class_forward_declarations?, #has_imports?, #has_protocol_declarations?, #has_protocol_forward_declarations?, #json_model?, #no_owner?

Constructor Details

#initialize(name, options) ⇒ ObjCImplementation

Returns a new instance of ObjCImplementation.



9
10
11
12
13
# File 'lib/nidyx/objc/implementation.rb', line 9

def initialize(name, options)
  super
  self.file_name = "#{name}.#{EXT}"
  self.imports = [name]
end

Instance Attribute Details

#name_overridesObject

Returns the value of attribute name_overrides.



7
8
9
# File 'lib/nidyx/objc/implementation.rb', line 7

def name_overrides
  @name_overrides
end

Instance Method Details

#name_override_stringObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/nidyx/objc/implementation.rb', line 19

def name_override_string
  string = ""
  count = 0
  name_overrides.each do |original, override|
    count += 1
    string += "@\"#{original}\": @\"#{override}\""
    string += ",\n" unless count == name_overrides.length
  end
  string
end

#name_overrides?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/nidyx/objc/implementation.rb', line 15

def name_overrides?
  !self.name_overrides.empty?
end