Class: OSDb::Sub

Inherits:
Object
  • Object
show all
Defined in:
lib/osdb/sub.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Sub

Returns a new instance of Sub.



9
10
11
12
13
14
15
# File 'lib/osdb/sub.rb', line 9

def initialize(data)
  @url = URI.parse(data['SubDownloadLink'])
  @format = data['SubFormat']
  @language = Language.from_iso639_2b(data['SubLanguageID'])
  @rating = data['SubRating']
  @raw_data = data
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



7
8
9
# File 'lib/osdb/sub.rb', line 7

def format
  @format
end

#languageObject (readonly)

Returns the value of attribute language.



7
8
9
# File 'lib/osdb/sub.rb', line 7

def language
  @language
end

#ratingObject (readonly)

Returns the value of attribute rating.



7
8
9
# File 'lib/osdb/sub.rb', line 7

def rating
  @rating
end

#raw_dataObject (readonly)

Returns the value of attribute raw_data.



7
8
9
# File 'lib/osdb/sub.rb', line 7

def raw_data
  @raw_data
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/osdb/sub.rb', line 7

def url
  @url
end