Class: Traktr::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/traktr/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, username = nil, password = nil, sha1 = false) ⇒ Client

Returns a new instance of Client.



19
20
21
22
23
# File 'lib/traktr/client.rb', line 19

def initialize(api_key, username = nil, password = nil, sha1 = false)
  @api_key = api_key || ""
  @username = username || ""
  @password = password ? (sha1 ? password : Digest::SHA1.hexdigest(password)) : ""
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



17
18
19
# File 'lib/traktr/client.rb', line 17

def api_key
  @api_key
end

#passwordObject (readonly)

Returns the value of attribute password.



17
18
19
# File 'lib/traktr/client.rb', line 17

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



17
18
19
# File 'lib/traktr/client.rb', line 17

def username
  @username
end

Instance Method Details

#accountObject



25
26
27
# File 'lib/traktr/client.rb', line 25

def 
  @account ||= Traktr::.new(self)
end

#movieObject



29
30
31
# File 'lib/traktr/client.rb', line 29

def movie
  @movie ||= Traktr::Movie.new(self)
end

#moviesObject



33
34
35
# File 'lib/traktr/client.rb', line 33

def movies
  @movies ||= Traktr::Movies.new(self)
end

#searchObject



37
38
39
# File 'lib/traktr/client.rb', line 37

def search
  @search ||= Traktr::Search.new(self)
end

#showObject



41
42
43
# File 'lib/traktr/client.rb', line 41

def show
  @show ||= Traktr::Show.new(self)
end

#showsObject



45
46
47
# File 'lib/traktr/client.rb', line 45

def shows
  @shows ||= Traktr::Shows.new(self)
end

#userObject



49
50
51
# File 'lib/traktr/client.rb', line 49

def user
  @user ||= Traktr::User.new(self)
end

#versionObject



53
54
55
# File 'lib/traktr/client.rb', line 53

def version
  @version ||= Traktr::Version.new(self)
end