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
-
#initialize(api_key, username = nil, password = nil, sha1 = false) ⇒ Client
constructor
A new instance of Client.
- #movie ⇒ Object
- #movies ⇒ Object
- #search ⇒ 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.
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_key ⇒ Object (readonly)
Returns the value of attribute api_key.
17 18 19 |
# File 'lib/traktr/client.rb', line 17 def api_key @api_key end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
17 18 19 |
# File 'lib/traktr/client.rb', line 17 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
17 18 19 |
# File 'lib/traktr/client.rb', line 17 def username @username end |
Instance Method Details
#account ⇒ Object
25 26 27 |
# File 'lib/traktr/client.rb', line 25 def account @account ||= Traktr::Account.new(self) end |
#movie ⇒ Object
29 30 31 |
# File 'lib/traktr/client.rb', line 29 def movie @movie ||= Traktr::Movie.new(self) end |
#movies ⇒ Object
33 34 35 |
# File 'lib/traktr/client.rb', line 33 def movies @movies ||= Traktr::Movies.new(self) end |
#search ⇒ Object
37 38 39 |
# File 'lib/traktr/client.rb', line 37 def search @search ||= Traktr::Search.new(self) end |
#show ⇒ Object
41 42 43 |
# File 'lib/traktr/client.rb', line 41 def show @show ||= Traktr::Show.new(self) end |
#shows ⇒ Object
45 46 47 |
# File 'lib/traktr/client.rb', line 45 def shows @shows ||= Traktr::Shows.new(self) end |
#user ⇒ Object
49 50 51 |
# File 'lib/traktr/client.rb', line 49 def user @user ||= Traktr::User.new(self) end |
#version ⇒ Object
53 54 55 |
# File 'lib/traktr/client.rb', line 53 def version @version ||= Traktr::Version.new(self) end |