Class: Bigrig::Descriptor
- Inherits:
-
Object
- Object
- Bigrig::Descriptor
- Defined in:
- lib/bigrig/descriptor.rb
Instance Attribute Summary collapse
-
#as_json ⇒ Object
readonly
Returns the value of attribute as_json.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(container_map, profiles) ⇒ Descriptor
constructor
A new instance of Descriptor.
Constructor Details
#initialize(container_map, profiles) ⇒ Descriptor
Returns a new instance of Descriptor.
7 8 9 10 11 12 13 14 |
# File 'lib/bigrig/descriptor.rb', line 7 def initialize(container_map, profiles) profiles.each do |_name, containers| containers.each do |container, overrides| apply_overrides container_map, container, overrides end end @as_json = container_map end |
Instance Attribute Details
#as_json ⇒ Object (readonly)
Returns the value of attribute as_json.
5 6 7 |
# File 'lib/bigrig/descriptor.rb', line 5 def as_json @as_json end |
Class Method Details
.read(file, active_profiles = []) ⇒ Object
16 17 18 19 |
# File 'lib/bigrig/descriptor.rb', line 16 def self.read(file, active_profiles = []) json = JSON.parse File.read file Descriptor.new json['containers'], profiles_for(json, active_profiles) end |