Class: Miasma::Models::Orchestration::Stack::Resources

Inherits:
Types::Collection show all
Defined in:
lib/miasma/models/orchestration/resources.rb

Overview

Abstract stack resources collection

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Resources) initialize(stack)

Override to capture originating stack

Parameters:



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

- (Miasma::Api) api (readonly) Originally defined in class Types::Collection

Returns underlying service API

Returns:

  • (Miasma::Api)

    underlying service API

- (Miasma::Models::Orchestration::Stack) stack (readonly)



12
13
14
# File 'lib/miasma/models/orchestration/resources.rb', line 12

def stack
  @stack
end

Instance Method Details

- (Resource) build(args = {})

Build a new resource instance

Parameters:

  • args (Hash) (defaults to: {})

    creation options

Returns:



34
35
36
# File 'lib/miasma/models/orchestration/resources.rb', line 34

def build(args={})
  Resource.new(stack, args.to_smash)
end

- (Array<Resources>) filter(options = {})

Return resources matching given filter

Parameters:

  • options (Hash) (defaults to: {})

    filter options

Returns:

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/miasma/models/orchestration/resources.rb', line 26

def filter(options={})
  raise NotImplementedError
end

- (Resource) model

Returns collection item class

Returns:



39
40
41
# File 'lib/miasma/models/orchestration/resources.rb', line 39

def model
  Resource
end