Class: IAM::Role

Inherits:
Object
  • Object
show all
Defined in:
lib/w-stdlib/aws.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Role

Returns a new instance of Role.



73
74
75
76
77
78
# File 'lib/w-stdlib/aws.rb', line 73

def initialize(params)
  @params = params
  @arn = params[:arn]
  @arn = params['Arn'] unless @arn
  @doc = AssumeRolePolicyDocument.from_role params
end

Instance Attribute Details

#arnObject (readonly)

Returns the value of attribute arn.



72
73
74
# File 'lib/w-stdlib/aws.rb', line 72

def arn
  @arn
end

#docObject (readonly)

Returns the value of attribute doc.



72
73
74
# File 'lib/w-stdlib/aws.rb', line 72

def doc
  @doc
end

Instance Method Details

#can_assume?(arn) ⇒ Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/w-stdlib/aws.rb', line 80

def can_assume?(arn)
  @doc.can_assume?(arn)
end