Module: Awspec::Helper::Finder::Elastictranscoder

Included in:
Awspec::Helper::Finder
Defined in:
lib/awspec/helper/finder/elastictranscoder.rb

Instance Method Summary collapse

Instance Method Details

#find_pipeline(id) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/awspec/helper/finder/elastictranscoder.rb', line 4

def find_pipeline(id)
  selected = []
  res = elastictranscoder_client.list_pipelines
  loop do
    selected += res.pipelines.select do |pipeline|
      pipeline.id == id || pipeline.name == id
    end
    (res.next_page? && res = res.next_page) || break
  end

  selected.single_resource(id)
end