Class: Ipodcastly::Client::Podcast
- Inherits:
-
Object
- Object
- Ipodcastly::Client::Podcast
- Defined in:
- lib/ipodcastly/client/podcast.rb
Constant Summary collapse
- @@itunes =
Appscript.app('iTunes')
- @@podcasts =
@@itunes.playlists.get.detect { |p| p.special_kind.get == :Podcasts }
Instance Attribute Summary collapse
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
- #episodes ⇒ Object
-
#initialize(title) ⇒ Podcast
constructor
A new instance of Podcast.
Constructor Details
#initialize(title) ⇒ Podcast
Returns a new instance of Podcast.
9 10 11 |
# File 'lib/ipodcastly/client/podcast.rb', line 9 def initialize(title) @title = title end |
Instance Attribute Details
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/ipodcastly/client/podcast.rb', line 4 def title @title end |
Class Method Details
.all ⇒ Object
17 18 19 |
# File 'lib/ipodcastly/client/podcast.rb', line 17 def self.all @@podcasts.tracks.get.map { |t| t.album.get }.uniq.map { |title| new(title) } end |
.find_by_title(title) ⇒ Object
21 22 23 |
# File 'lib/ipodcastly/client/podcast.rb', line 21 def self.find_by_title(title) all.detect { |p| p.title == title } end |
.subscribe(url) ⇒ Object
25 26 27 |
# File 'lib/ipodcastly/client/podcast.rb', line 25 def self.subscribe(url) @@itunes.subscribe(url) end |