class AwsCliConfigParser::Profile
Attributes
configuration[R]
name[R]
Public Class Methods
new(name, configuration)
click to toggle source
# File lib/aws_cli_config_parser/profile.rb, line 5 def initialize name, configuration @name = name.to_str ; raise ArgumentError if @name.empty? @configuration = configuration end
Public Instance Methods
get(key)
click to toggle source
# File lib/aws_cli_config_parser/profile.rb, line 28 def get key @configuration[key] end
merge!(other)
click to toggle source
# File lib/aws_cli_config_parser/profile.rb, line 16 def merge! other raise TypeError unless other.is_a?(self.class) @configuration.merge!(other.configuration) self end
merge_credential!(credential)
click to toggle source
# File lib/aws_cli_config_parser/profile.rb, line 24 def merge_credential! credential @configuration.merge!(credential.configuration) end
role()
click to toggle source
# File lib/aws_cli_config_parser/profile.rb, line 12 def role @configuration['role_arn'].to_s.match(%r|arn:aws:iam:\w*:(\d{12}):role/(.+?)/?$|)&.captures end
to_h()
click to toggle source
# File lib/aws_cli_config_parser/profile.rb, line 32 def to_h @configuration.to_h end