Class: PodcastIndex::Category

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/podcast_index/category.rb

Class Method Summary collapse

Class Method Details

.allObject



14
15
16
17
# File 'lib/podcast_index/category.rb', line 14

def all
  response = Api::Categories.list
  from_response_collection(response)
end

.find(id) ⇒ Object



7
8
9
10
11
12
# File 'lib/podcast_index/category.rb', line 7

def find(id)
  category = all.detect { |element| element.id == id }
  raise PodcastIndex::CategoryNotFound if category.nil?

  category
end