Class: InstanceAgent::CodeDeployPlugin::ApplicationSpecification::ContextInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/instance_agent/codedeploy_plugin/application_specification/context_info.rb

Overview

Helper Class for storing a context

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ ContextInfo

Returns a new instance of ContextInfo.



10
11
12
13
14
15
16
17
18
# File 'lib/instance_agent/codedeploy_plugin/application_specification/context_info.rb', line 10

def initialize(context)
  if context['type'].nil?
    raise AppSpecValidationException, "invalid context type required #{context.inspect}"
  end
  @user = context['name']
  @role = nil
  @type = context['type']
  @range = context['range'].nil? ? nil : RangeInfo.new(context['range'])
end

Instance Attribute Details

#rangeObject (readonly)

Returns the value of attribute range.



8
9
10
# File 'lib/instance_agent/codedeploy_plugin/application_specification/context_info.rb', line 8

def range
  @range
end

#roleObject (readonly)

Returns the value of attribute role.



8
9
10
# File 'lib/instance_agent/codedeploy_plugin/application_specification/context_info.rb', line 8

def role
  @role
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/instance_agent/codedeploy_plugin/application_specification/context_info.rb', line 8

def type
  @type
end

#userObject (readonly)

Returns the value of attribute user.



8
9
10
# File 'lib/instance_agent/codedeploy_plugin/application_specification/context_info.rb', line 8

def user
  @user
end