Class: Miasma::Models::Orchestration::Stacks

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

Overview

Abstract stack collection

Instance Attribute Summary

Attributes inherited from Types::Collection

#api

Instance Method Summary collapse

Methods inherited from Types::Collection

#all, #build, #from_json, #initialize, #reload, #to_json

Methods included from Utils::Memoization

#_memo, #clear_memoizations!, #memoize, #unmemoize

Constructor Details

This class inherits a constructor from Miasma::Types::Collection

Instance Method Details

#filter(options = {}) ⇒ Array<Stack>

Return stacks matching given filter

Parameters:

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

    filter options

Options Hash (options):

  • :state (String)

    current stack state

Returns:

Raises:

  • (NotImplementedError)


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

def filter(options={})
  raise NotImplementedError
end

#get(ident) ⇒ Stack

Locate stack by name or ID

Parameters:

  • ident (String, Numeric)

    name or ID

Returns:



14
15
16
17
18
19
# File 'lib/miasma/models/orchestration/stacks.rb', line 14

def get(ident)
  all.detect do |stack|
    stack.id.to_s == ident.to_s ||
      stack.name.to_s == ident.to_s
  end
end

#modelStack

Returns collection items class.

Returns:

  • (Stack)

    collection items class



31
32
33
# File 'lib/miasma/models/orchestration/stacks.rb', line 31

def model
  Stack
end