Class: Addic7ed::Subtitle

Inherits:
Object
  • Object
show all
Defined in:
lib/addic7ed/subtitle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version, language, status, url, via, downloads) ⇒ Subtitle

Returns a new instance of Subtitle.



7
8
9
10
11
12
13
14
# File 'lib/addic7ed/subtitle.rb', line 7

def initialize(version, language, status, url, via, downloads)
  @version   = normalized_version(version)
  @language  = language
  @status    = status
  @url       = url
  @via       = via
  @downloads = downloads.to_i
end

Instance Attribute Details

#downloadsObject (readonly)

Returns the value of attribute downloads.



4
5
6
# File 'lib/addic7ed/subtitle.rb', line 4

def downloads
  @downloads
end

#languageObject (readonly)

Returns the value of attribute language.



4
5
6
# File 'lib/addic7ed/subtitle.rb', line 4

def language
  @language
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/addic7ed/subtitle.rb', line 4

def status
  @status
end

#urlObject

Returns the value of attribute url.



5
6
7
# File 'lib/addic7ed/subtitle.rb', line 5

def url
  @url
end

#versionObject (readonly)

Returns the value of attribute version.



4
5
6
# File 'lib/addic7ed/subtitle.rb', line 4

def version
  @version
end

#viaObject (readonly)

Returns the value of attribute via.



4
5
6
# File 'lib/addic7ed/subtitle.rb', line 4

def via
  @via
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/addic7ed/subtitle.rb', line 16

def to_s
  "#{url}\t->\t#{@version} (#{language}, #{status}) [#{@downloads} downloads]#{" (via #{via})" if @via}"
end