class AWS::IAM::Resource

Private Class Methods

prefix_update_attributes(prefix = 'new_') click to toggle source

@api private

# File lib/aws/iam/resource.rb, line 49
def prefix_update_attributes prefix = 'new_'
  @update_prefix = prefix
end
update_prefix() click to toggle source

@api private

# File lib/aws/iam/resource.rb, line 54
def update_prefix
  @update_prefix
end

Public Instance Methods

exists?() click to toggle source

@return [Boolean] Returns ‘true` if the resource exists.

# File lib/aws/iam/resource.rb, line 19
def exists?
  get_resource
  true
rescue Errors::NoSuchEntity => e
  false
end

Private Instance Methods

get_resource(attribute = nil) click to toggle source
# File lib/aws/iam/resource.rb, line 34
def get_resource attribute = nil
  client.send(get_resource_client_method, resource_options)
end
get_resource_client_method() click to toggle source
# File lib/aws/iam/resource.rb, line 38
def get_resource_client_method
  "get_#{ruby_name}"
end
update_resource(attr, value) click to toggle source
# File lib/aws/iam/resource.rb, line 28
def update_resource attr, value
  options = { :"#{self.class.update_prefix}#{attr.set_as}" => value }
  client_method = update_resource_client_method
  client.send(client_method, options.merge(resource_options))
end
update_resource_client_method() click to toggle source
# File lib/aws/iam/resource.rb, line 42
def update_resource_client_method
  "update_#{ruby_name}"
end