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.

Parameters:

  • tvdb (Client) (defaults to: nil)

    a TVDB api client. Only to compatibily with Client and Episode constructor.

  • hash (Hash) (defaults to: {})

    the optional hash, if given, will generate attributes and values (can be a Hash, an OpenStruct or a Struct).



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

Returns the url string of relative image path stored in ‘image` field. `nil` if `image` field is `nil`.

Returns:

  • (String)

    the url string of relative image path stored in ‘image` field. `nil` if `image` field is `nil`.



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