Class: Tvdb2::TvdbStruct

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/tvdb2/tvdb_struct.rb

Overview

OpenStruct that define ‘_url` methods to get url from images relative paths returned from api.

Examples:

got = client.best_search('Game of Thrones')
puts got.posters.first.fileName     # print relative path posters/121361-1.jpg
puts got.posters.first.fileName_url # print url https://thetvdb.com/banners/posters/121361-1.jpg

Instance Method Summary collapse

Constructor Details

#initialize(tvdb = nil, hash = {}) ⇒ TvdbStruct

Note:

You should never need to create this object manually.

Returns a new instance of TvdbStruct.



19
20
21
# File 'lib/tvdb2/tvdb_struct.rb', line 19

def initialize(tvdb = nil, hash = {})
  super(hash)
end

Instance Method Details

#fileName_urlObject Also known as: url

‘fileName` field. `nil` if `fileName` field is `nil`.



6
# File 'lib/tvdb2/tvdb_struct.rb', line 6

def fileName_url; end

#image_urlString



3
# File 'lib/tvdb2/tvdb_struct.rb', line 3

def image_url; end

#thumbnail_urlObject

‘thumbnail` field. `nil` if `thumbnail` field is `nil`.



9
# File 'lib/tvdb2/tvdb_struct.rb', line 9

def thumbnail_url; end