Class: Miasma::Models::Orchestration::Stack
- Inherits:
-
Types::Model
- Object
- Types::Data
- Types::Model
- Miasma::Models::Orchestration::Stack
- Includes:
- Utils::Memoization
- Defined in:
- lib/miasma/models/orchestration/stack.rb,
lib/miasma/models/orchestration/event.rb,
lib/miasma/models/orchestration/events.rb,
lib/miasma/models/orchestration/resource.rb,
lib/miasma/models/orchestration/resources.rb
Overview
Abstract server
Defined Under Namespace
Classes: Event, Events, Output, Resource, Resources
Instance Attribute Summary (collapse)
-
- (Miasma::Types::Api) api
inherited
from Types::Model
readonly
Underlying service API.
Instance Method Summary (collapse)
- - (Object) _memo included from Utils::Memoization
-
- (TrueClass) clear_memoizations!
included
from Utils::Memoization
Remove all memoized values.
- - (Events) events
-
- (Object) load_data(args = {})
Overload the loader so we can extract resources, events, and outputs.
-
- (Object) memoize(key, direct = false) { ... }
included
from Utils::Memoization
Memoize data.
-
- (self) reload
Override to scrub custom caches.
- - (Resources) resources
-
- (Object) save
Always perform save.
-
- (NilClass) unmemoize(key, direct = false)
included
from Utils::Memoization
Remove memoized value.
-
- (TrueClass) validate
Validate the stack template.
Constructor Details
This class inherits a constructor from Miasma::Types::Model
Instance Attribute Details
- (Miasma::Types::Api) api (readonly) Originally defined in class Types::Model
Returns underlying service API
Instance Method Details
- (Object) _memo Originally defined in module Utils::Memoization
- (TrueClass) clear_memoizations! Originally defined in module Utils::Memoization
Remove all memoized values
- (Events) events
87 88 89 90 91 |
# File 'lib/miasma/models/orchestration/stack.rb', line 87 def events memoize(:events) do Events.new(self) end end |
- (Object) load_data(args = {})
Overload the loader so we can extract resources, events, and outputs
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/miasma/models/orchestration/stack.rb', line 53 def load_data(args={}) args = args.to_smash @resources = (args.delete(:resources) || []).each do |r| Resource.new(r) end @events = (args.delete(:events) || []).each do |e| Event.new(e) end super args end |
- (Object) memoize(key, direct = false) { ... } Originally defined in module Utils::Memoization
Memoize data
- (self) reload
Override to scrub custom caches
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/miasma/models/orchestration/stack.rb', line 75 def reload clear_memoizations! remove = data.keys.find_all do |k| ![:id, :name].include?(k.to_sym) end remove.each do |k| data.delete(k) end super end |
- (Resources) resources
94 95 96 97 98 |
# File 'lib/miasma/models/orchestration/stack.rb', line 94 def resources memoize(:resources) do Resources.new(self) end end |
- (Object) save
Always perform save. Remove dirty check provided by default.
102 103 104 |
# File 'lib/miasma/models/orchestration/stack.rb', line 102 def save perform_save end |
- (NilClass) unmemoize(key, direct = false) Originally defined in module Utils::Memoization
Remove memoized value
- (TrueClass) validate
Validate the stack template
68 69 70 |
# File 'lib/miasma/models/orchestration/stack.rb', line 68 def validate perform_template_validate end |