Class: Addic7ed::Subtitle
- Inherits:
-
Object
- Object
- Addic7ed::Subtitle
- Defined in:
- lib/addic7ed/subtitle.rb
Instance Attribute Summary collapse
-
#downloads ⇒ Object
readonly
Returns the value of attribute downloads.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#url ⇒ Object
Returns the value of attribute url.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
-
#via ⇒ Object
readonly
Returns the value of attribute via.
Instance Method Summary collapse
-
#initialize(version, language, status, url, via, downloads) ⇒ Subtitle
constructor
A new instance of Subtitle.
- #to_s ⇒ Object
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
#downloads ⇒ Object (readonly)
Returns the value of attribute downloads.
4 5 6 |
# File 'lib/addic7ed/subtitle.rb', line 4 def downloads @downloads end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
4 5 6 |
# File 'lib/addic7ed/subtitle.rb', line 4 def language @language end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/addic7ed/subtitle.rb', line 4 def status @status end |
#url ⇒ Object
Returns the value of attribute url.
5 6 7 |
# File 'lib/addic7ed/subtitle.rb', line 5 def url @url end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
4 5 6 |
# File 'lib/addic7ed/subtitle.rb', line 4 def version @version end |
#via ⇒ Object (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_s ⇒ Object
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 |