Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/awspec/ext/array.rb

Instance Method Summary collapse

Instance Method Details

#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