Class: Traktr::Client
- Inherits:
-
Object
- Object
- Traktr::Client
- Defined in:
- lib/traktr/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #account ⇒ Object
- #activity ⇒ Object
- #calendar ⇒ Object
- #comment ⇒ Object
- #genres ⇒ Object
-
#initialize(api_key, username = nil, password = nil, sha1 = false) ⇒ Client
constructor
A new instance of Client.
- #lists ⇒ Object
- #movie ⇒ Object
- #movies ⇒ Object
- #network ⇒ Object
- #rate ⇒ Object
- #recommendations ⇒ Object
- #search ⇒ Object
- #server ⇒ Object
- #show ⇒ Object
- #shows ⇒ Object
- #user ⇒ Object
- #version ⇒ Object
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_key ⇒ Object (readonly)
Returns the value of attribute api_key.
38 39 40 |
# File 'lib/traktr/client.rb', line 38 def api_key @api_key end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
38 39 40 |
# File 'lib/traktr/client.rb', line 38 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
38 39 40 |
# File 'lib/traktr/client.rb', line 38 def username @username end |
Instance Method Details
#account ⇒ Object
46 47 48 |
# File 'lib/traktr/client.rb', line 46 def account @account ||= Traktr::Account.new(self) end |
#activity ⇒ Object
50 51 52 |
# File 'lib/traktr/client.rb', line 50 def activity @activity ||= Traktr::Activity.new(self) end |
#calendar ⇒ Object
54 55 56 |
# File 'lib/traktr/client.rb', line 54 def calendar @calendar ||= Traktr::Calendar.new(self) end |
#comment ⇒ Object
58 59 60 |
# File 'lib/traktr/client.rb', line 58 def comment @comment ||= Traktr::Comment.new(self) end |
#genres ⇒ Object
62 63 64 |
# File 'lib/traktr/client.rb', line 62 def genres @genres ||= Traktr::Genres.new(self) end |
#lists ⇒ Object
66 67 68 |
# File 'lib/traktr/client.rb', line 66 def lists @lists ||= Traktr::Lists.new(self) end |
#movie ⇒ Object
74 75 76 |
# File 'lib/traktr/client.rb', line 74 def movie @movie ||= Traktr::Movie.new(self) end |
#movies ⇒ Object
78 79 80 |
# File 'lib/traktr/client.rb', line 78 def movies @movies ||= Traktr::Movies.new(self) end |
#network ⇒ Object
70 71 72 |
# File 'lib/traktr/client.rb', line 70 def network @network ||= Traktr::Network.new(self) end |
#rate ⇒ Object
82 83 84 |
# File 'lib/traktr/client.rb', line 82 def rate @rate ||= Traktr::Rate.new(self) end |
#recommendations ⇒ Object
86 87 88 |
# File 'lib/traktr/client.rb', line 86 def recommendations @recommendations ||= Traktr::Recommendations.new(self) end |
#search ⇒ Object
90 91 92 |
# File 'lib/traktr/client.rb', line 90 def search @search ||= Traktr::Search.new(self) end |
#server ⇒ Object
94 95 96 |
# File 'lib/traktr/client.rb', line 94 def server @server ||= Traktr::Server.new(self) end |
#show ⇒ Object
98 99 100 |
# File 'lib/traktr/client.rb', line 98 def show @show ||= Traktr::Show.new(self) end |
#shows ⇒ Object
102 103 104 |
# File 'lib/traktr/client.rb', line 102 def shows @shows ||= Traktr::Shows.new(self) end |
#user ⇒ Object
106 107 108 |
# File 'lib/traktr/client.rb', line 106 def user @user ||= Traktr::User.new(self) end |
#version ⇒ Object
110 111 112 |
# File 'lib/traktr/client.rb', line 110 def version @version ||= Traktr::Version.new(self) end |