class Yamazaki::Torrent
Attributes
description[R]
filename[RW]
index[R]
link[R]
pub_date[R]
title[R]
Public Class Methods
from_rss(hash, index)
click to toggle source
# File lib/yamazaki/torrent.rb, line 36 def from_rss(hash, index) Torrent.new(hash.title, hash.description, hash.pubDate, hash.link, index) end
new(title, description, pub_date, link, index = 0, filename="")
click to toggle source
# File lib/yamazaki/torrent.rb, line 20 def initialize(title, description, pub_date, link, index = 0, filename="") raise ArgumentError.new("you cannot have a negative index!") if index < 0 @title = title @description = description @pub_date = pub_date @link = link @index = index @filename = filename end
Public Instance Methods
to_s()
click to toggle source
# File lib/yamazaki/torrent.rb, line 31 def to_s "#{(@index + 1).to_s.black.cyan} #{@title.bold} #{@pub_date.strftime('%m/%d/%Y %H:%M'.freeze).color(50)}\n" end