Sha256: c44d78204462a86daf369d609fcd9b78701c8802f04dba56c46ff86eca66247a

Contents?: true

Size: 580 Bytes

Versions: 12

Compression:

Stored size: 580 Bytes

Contents

# encoding: utf-8
module Junkie

  require 'sindex'

  class Episode
    attr_reader :id, :series, :found_at, :link
    attr_accessor :description, :status, :pid

    def initialize(series, link, description=nil)
      @series = series
      @link = link
      @found_at = DateTime.now
      @description = description
      @status = :found
      @id = episode_identifier
    end

    def to_s
      "%s (%s)" % [ @series, episode_identifier ]
    end

    private

    def episode_identifier
      Sindex::SeriesIndex.extract_episode_identifier(@description)
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
junkie-0.0.15 lib/junkie/episode.rb
junkie-0.0.14 lib/junkie/episode.rb
junkie-0.0.13 lib/junkie/episode.rb
junkie-0.0.12 lib/junkie/episode.rb
junkie-0.0.11 lib/junkie/episode.rb
junkie-0.0.10 lib/junkie/episode.rb
junkie-0.0.9 lib/junkie/episode.rb
junkie-0.0.8 lib/junkie/episode.rb
junkie-0.0.7 lib/junkie/episode.rb
junkie-0.0.6 lib/junkie/episode.rb
junkie-0.0.5 lib/junkie/episode.rb
junkie-0.0.4 lib/junkie/episode.rb