Class: Pandora::Models::File

Inherits:
Object
  • Object
show all
Defined in:
lib/pandora/models/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yml) ⇒ PandoraFile

Initializes the pandora file from a YAML file.

Parameters:

  • YAML (Hash/Arry)

    file that represents the file.

Raises:

  • (StandardError)

    if there’s an error in the file definition.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/pandora/models/file.rb', line 14

def initialize(yml)
  yml_apps = yml["apps"]
  yml_apps ||= []
  @apps = yml_apps.map { |app_name, app|
    App.from_yml(app_name.to_s, app)
  }
  yml_frameworks = yml["frameworks"]
  yml_frameworks ||= []
  @frameworks = yml_frameworks.map { |framework_name, framework|
    Framework.from_yml(framework_name.to_s, framework)
  }
end

Instance Attribute Details

#appsObject (readonly)

Returns the value of attribute apps.



8
9
10
# File 'lib/pandora/models/file.rb', line 8

def apps
  @apps
end

#frameworksObject (readonly)

Returns the value of attribute frameworks.



8
9
10
# File 'lib/pandora/models/file.rb', line 8

def frameworks
  @frameworks
end