class Wanko::Data::Torrent

Class for torrent data. Contains the name of and the link to a torrent, as well as the directory the torrent will be downloaded to.

Attributes

dir[R]
name[R]

Public Class Methods

new(name, link, dir) click to toggle source
# File lib/wanko/data.rb, line 11
def initialize(name, link, dir)
  @name = name
  @link = link
  @dir = dir
end

Public Instance Methods

to_h() click to toggle source

Returns a Hash representation of this Torrent

# File lib/wanko/data.rb, line 20
def to_h()
  {
    name: name,
    link: link,
    dir: dir
  }
end
to_json(state = nil) click to toggle source

Returns a JSON representation of this Torrent

# File lib/wanko/data.rb, line 29
def to_json(state = nil)
  to_h.to_json state
end