Method: Array#single_resource

Defined in:
lib/awspec/ext/array.rb

#single_resource(id = nil) ⇒ Object



2
3
4
5
6
7
# File 'lib/awspec/ext/array.rb', line 2

def single_resource(id = nil)
  if self.count > 1
    raise Awspec::DuplicatedResourceTypeError, "Duplicated resource type #{id}"
  end
  self.first if self.count == 1
end