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.



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

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.



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

def api_key
  @api_key
end

#passwordObject (readonly)

Returns the value of attribute password.



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

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



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

def username
  @username
end

Instance Method Details

#accountObject



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

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

#activityObject



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

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

#calendarObject



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

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

#commentObject



58
59
60
# File 'lib/traktr/client.rb', line 58

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

#genresObject



62
63
64
# File 'lib/traktr/client.rb', line 62

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

#listsObject



66
67
68
# File 'lib/traktr/client.rb', line 66

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

#movieObject



74
75
76
# File 'lib/traktr/client.rb', line 74

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

#moviesObject



78
79
80
# File 'lib/traktr/client.rb', line 78

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

#networkObject



70
71
72
# File 'lib/traktr/client.rb', line 70

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

#rateObject



82
83
84
# File 'lib/traktr/client.rb', line 82

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

#recommendationsObject



86
87
88
# File 'lib/traktr/client.rb', line 86

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

#searchObject



90
91
92
# File 'lib/traktr/client.rb', line 90

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

#serverObject



94
95
96
# File 'lib/traktr/client.rb', line 94

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

#showObject



98
99
100
# File 'lib/traktr/client.rb', line 98

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

#showsObject



102
103
104
# File 'lib/traktr/client.rb', line 102

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

#userObject



106
107
108
# File 'lib/traktr/client.rb', line 106

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

#versionObject



110
111
112
# File 'lib/traktr/client.rb', line 110

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