Class: Miasma::Models::Orchestration::Stack::Plans

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

Overview

Abstract stack plans collection

Instance Attribute Summary collapse

Attributes inherited from Types::Collection

#api

Instance Method Summary collapse

Methods inherited from Types::Collection

#all, #from_json, #get, #reload, #to_json

Methods included from Utils::ApiMethoding

#api_method_for

Constructor Details

#initialize(stack) ⇒ Plans

Override to capture originating stack

Parameters:



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

def initialize(stack)
  @stack = stack
  super stack.api
end

Instance Attribute Details

#stackMiasma::Models::Orchestration::Stack (readonly)



11
12
13
# File 'lib/miasma/models/orchestration/plans.rb', line 11

def stack
  @stack
end

Instance Method Details

#build(args = {}) ⇒ Plan

Build a new plan instance

Parameters:

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

    creation options

Returns:



33
34
35
# File 'lib/miasma/models/orchestration/plans.rb', line 33

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

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

Return plans matching given filter

Parameters:

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

    filter options

Returns:

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/miasma/models/orchestration/plans.rb', line 25

def filter(options = {})
  raise NotImplementedError
end

#modelPlan

Returns collection item class.

Returns:

  • (Plan)

    collection item class



38
39
40
# File 'lib/miasma/models/orchestration/plans.rb', line 38

def model
  Plan
end