class PodcastFinder::Station

Attributes

name[RW]
podcasts[R]
url[RW]

Public Class Methods

all() click to toggle source
# File lib/podcast_finder/station.rb, line 26
def self.all
  @@all
end
find_by_name(name) click to toggle source
# File lib/podcast_finder/station.rb, line 30
def self.find_by_name(name)
  self.all.detect {|item| item.name == name}
end
new(podcast_hash) click to toggle source
# File lib/podcast_finder/station.rb, line 8
def initialize(podcast_hash)
  @name = podcast_hash[:station]
  @url = podcast_hash[:station_url]
  @podcasts = []
  self.save
end

Public Instance Methods

add_podcast(podcast) click to toggle source
# File lib/podcast_finder/station.rb, line 15
def add_podcast(podcast)
  if podcast.class == PodcastFinder::Podcast
    @podcasts << podcast
    podcast.station = self
  end
end
save() click to toggle source
# File lib/podcast_finder/station.rb, line 22
def save
  @@all << self
end