Class: Bosh::Director::DeploymentPlan::NetworkPlanner::Plan

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/deployment_plan/network_planner/plan.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ Plan

Returns a new instance of Plan.



4
5
6
7
8
# File 'lib/bosh/director/deployment_plan/network_planner/plan.rb', line 4

def initialize(attrs)
  @reservation = attrs.fetch(:reservation)
  @obsolete = attrs.fetch(:obsolete, false)
  @existing = attrs.fetch(:existing, false)
end

Instance Attribute Details

#existingObject

Returns the value of attribute existing.



11
12
13
# File 'lib/bosh/director/deployment_plan/network_planner/plan.rb', line 11

def existing
  @existing
end

#reservationObject (readonly)

Returns the value of attribute reservation.



10
11
12
# File 'lib/bosh/director/deployment_plan/network_planner/plan.rb', line 10

def reservation
  @reservation
end

Instance Method Details

#desired?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/bosh/director/deployment_plan/network_planner/plan.rb', line 17

def desired?
  !existing? && !obsolete?
end

#existing?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/bosh/director/deployment_plan/network_planner/plan.rb', line 21

def existing?
  !!@existing
end

#obsolete?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/bosh/director/deployment_plan/network_planner/plan.rb', line 13

def obsolete?
  !!@obsolete
end