Class: Miasma::Models::Orchestration::Stack::Resources
- Inherits:
-
Types::Collection
- Object
- Types::Collection
- Miasma::Models::Orchestration::Stack::Resources
- Defined in:
- lib/miasma/models/orchestration/resources.rb
Overview
Abstract stack resources collection
Instance Attribute Summary collapse
Attributes inherited from Types::Collection
Instance Method Summary collapse
-
#build(args = {}) ⇒ Resource
Build a new resource instance.
-
#filter(options = {}) ⇒ Array<Resources>
Return resources matching given filter.
-
#initialize(stack) ⇒ Resources
constructor
Override to capture originating stack.
-
#model ⇒ Resource
Collection item class.
Methods inherited from Types::Collection
#all, #from_json, #get, #reload, #to_json
Methods included from Utils::Memoization
#_memo, #clear_memoizations!, #memoize, #unmemoize
Constructor Details
#initialize(stack) ⇒ Resources
Override to capture originating stack
17 18 19 20 |
# File 'lib/miasma/models/orchestration/resources.rb', line 17 def initialize(stack) @stack = stack super stack.api end |
Instance Attribute Details
#stack ⇒ Miasma::Models::Orchestration::Stack (readonly)
12 13 14 |
# File 'lib/miasma/models/orchestration/resources.rb', line 12 def stack @stack end |
Instance Method Details
#build(args = {}) ⇒ Resource
Build a new resource instance
34 35 36 |
# File 'lib/miasma/models/orchestration/resources.rb', line 34 def build(args={}) Resource.new(stack, args.to_smash) end |
#filter(options = {}) ⇒ Array<Resources>
Return resources matching given filter
26 27 28 |
# File 'lib/miasma/models/orchestration/resources.rb', line 26 def filter(={}) raise NotImplementedError end |