Module: Simplecast::Client::Episode
- Extended by:
- Resource
- Defined in:
- lib/simplecast/client/episode.rb
Instance Attribute Summary
#api_key, #podcast_id
Class Method Summary
collapse
Methods included from Resource
all, client, find, model, resource_plural_name_lower
#configure, keys, #options
Class Method Details
.all(podcast_id = nil) ⇒ Object
15
16
17
18
19
|
# File 'lib/simplecast/client/episode.rb', line 15
def all(podcast_id = nil)
podcast_id ||= client.podcast_id
api_obj_array = client.get("podcasts/#{podcast_id}/episodes.json")
api_obj_array.map {|api_obj| model.new(api_obj) }
end
|
.embed(id, podcast_id = nil) ⇒ Object
11
12
13
14
|
# File 'lib/simplecast/client/episode.rb', line 11
def embed(id, podcast_id = nil)
podcast_id ||= client.podcast_id
api_obj = client.get("podcasts/#{podcast_id}/episodes/#{id}/embed.json")
end
|
.find(id, podcast_id = nil) ⇒ Object
6
7
8
9
10
|
# File 'lib/simplecast/client/episode.rb', line 6
def find(id, podcast_id = nil)
podcast_id ||= client.podcast_id
api_obj = client.get("podcasts/#{podcast_id}/episodes/#{id}.json")
model.new(api_obj)
end
|