Class: TheTvDbParty::Actor

Inherits:
Object
  • Object
show all
Defined in:
lib/thetvdb_party/actor.rb

Overview

Actors holds information about actors

See also

thetvdb.com/wiki/index.php/API:actors.xml

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, hashValues) ⇒ Actor

Initializes a new Actor as it was retrieved from a given client.

Parameters
client

The TheTvDbParty::Client instance that retrieved the record this actor belongs to.

hashValues

A Hash=> String instance that maps the actor element names to their string values.


22
23
24
25
26
27
# File 'lib/thetvdb_party/actor.rb', line 22

def initialize(client, hashValues)
  @client = client
  @hashValues = hashValues

  read_hash_values
end

Instance Attribute Details

#clientObject (readonly)

The client that was used to get this actor


6
7
8
# File 'lib/thetvdb_party/actor.rb', line 6

def client
  @client
end

#idObject (readonly)

Useless field, will eventually be used to link actors between series but currently isn't in use and may actually change once it gets fully implemented so don't bother storing it at all.


8
9
10
# File 'lib/thetvdb_party/actor.rb', line 8

def id
  @id
end

#image_path_relativeObject (readonly)

Can be appended to <mirrorpath>/banners/ to determine the actual location of the artwork.


10
11
12
# File 'lib/thetvdb_party/actor.rb', line 10

def image_path_relative
  @image_path_relative
end

#nameObject (readonly)

The actors real name.


12
13
14
# File 'lib/thetvdb_party/actor.rb', line 12

def name
  @name
end

#roleObject (readonly)

The name of the actors character in the series.


14
15
16
# File 'lib/thetvdb_party/actor.rb', line 14

def role
  @role
end

#sort_orderObject (readonly)

An integer from 0-3. 1 being the most important actor on the show and 3 being the third most important actor. 0 means they have no special sort order. Duplicates of 1-3 aren't suppose to be allowed but currently are so the field isn't perfect but can still be used for basic sorting.


16
17
18
# File 'lib/thetvdb_party/actor.rb', line 16

def sort_order
  @sort_order
end

Instance Method Details

#image_path_fullObject


29
30
31
32
33
# File 'lib/thetvdb_party/actor.rb', line 29

def image_path_full
  if @image_path_relative
    return (URI::join(BASE_URL, "banners/", @image_path_relative))
  end
end