Class: PodAlexandria::Dependency

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-alexandria/xcodegen/dependency.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Dependency

Returns a new instance of Dependency.



6
7
8
9
# File 'lib/cocoapods-alexandria/xcodegen/dependency.rb', line 6

def initialize(value)
  @flag = value.start_with?('-wf') ? 'wf' : value[1]
  @module_name = value.delete_prefix('-l').delete_prefix('-f').delete_prefix('-wf')
end

Instance Attribute Details

#flagObject (readonly)

Returns the value of attribute flag.



3
4
5
# File 'lib/cocoapods-alexandria/xcodegen/dependency.rb', line 3

def flag
  @flag
end

#module_nameObject (readonly)

Returns the value of attribute module_name.



4
5
6
# File 'lib/cocoapods-alexandria/xcodegen/dependency.rb', line 4

def module_name
  @module_name
end

Instance Method Details

#xcodegen_info(allow_embed) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/cocoapods-alexandria/xcodegen/dependency.rb', line 11

def xcodegen_info(allow_embed)
  if exists?
    {
      'framework' => path,
      'embed' => is_dynamic? && allow_embed,
      'weak' => is_weak?
    }
  else
    {
      'sdk' => sdk,
      'weak' => is_weak?
    }
  end
end