Class: Pandora::Models::Framework
- Inherits:
-
Object
- Object
- Pandora::Models::Framework
- Defined in:
- lib/pandora/models/framework.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Array of dependencies (names).
-
#name ⇒ Object
readonly
Framework name.
-
#project_path ⇒ Object
readonly
Project path (.xcodeproj).
Class Method Summary collapse
-
.from_yml(name, yml) ⇒ Framework
Initializes a Framework from a YAML dictionary.
Instance Method Summary collapse
-
#initialize(name, project_path, dependencies) ⇒ Framework
constructor
Initializes the framework from a YML hash.
Constructor Details
#initialize(name, project_path, dependencies) ⇒ Framework
Initializes the framework from a YML hash.
19 20 21 22 23 24 |
# File 'lib/pandora/models/framework.rb', line 19 def initialize(name, project_path, dependencies) @name = name @project_path = project_path raise "Wrong project path. It should be a .xcodeproj" unless @project_path.include?(".xcodeproj") @dependencies = dependencies end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Array of dependencies (names)
12 13 14 |
# File 'lib/pandora/models/framework.rb', line 12 def dependencies @dependencies end |
#name ⇒ Object (readonly)
Framework name
6 7 8 |
# File 'lib/pandora/models/framework.rb', line 6 def name @name end |
#project_path ⇒ Object (readonly)
Project path (.xcodeproj)
9 10 11 |
# File 'lib/pandora/models/framework.rb', line 9 def project_path @project_path end |
Class Method Details
.from_yml(name, yml) ⇒ Framework
Initializes a Framework from a YAML dictionary.
31 32 33 34 35 36 37 |
# File 'lib/pandora/models/framework.rb', line 31 def self.from_yml(name, yml) project_path = yml["project_path"] raise "Project not specified for framework #{name}" unless project_path dependencies = yml["dependencies"] dependencies ||= [] Framework.new(name, project_path, dependencies) end |