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
-
#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.
21 22 23 24 25 |
# File 'lib/traktr/client.rb', line 21 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.
19 20 21 |
# File 'lib/traktr/client.rb', line 19 def api_key @api_key end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
19 20 21 |
# File 'lib/traktr/client.rb', line 19 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
19 20 21 |
# File 'lib/traktr/client.rb', line 19 def username @username end |
Instance Method Details
#account ⇒ Object
27 28 29 |
# File 'lib/traktr/client.rb', line 27 def account @account ||= Traktr::Account.new(self) end |
#activity ⇒ Object
31 32 33 |
# File 'lib/traktr/client.rb', line 31 def activity @activity ||= Traktr::Activity.new(self) end |
#movie ⇒ Object
35 36 37 |
# File 'lib/traktr/client.rb', line 35 def movie @movie ||= Traktr::Movie.new(self) end |
#movies ⇒ Object
39 40 41 |
# File 'lib/traktr/client.rb', line 39 def movies @movies ||= Traktr::Movies.new(self) end |
#search ⇒ Object
43 44 45 |
# File 'lib/traktr/client.rb', line 43 def search @search ||= Traktr::Search.new(self) end |
#show ⇒ Object
47 48 49 |
# File 'lib/traktr/client.rb', line 47 def show @show ||= Traktr::Show.new(self) end |
#shows ⇒ Object
51 52 53 |
# File 'lib/traktr/client.rb', line 51 def shows @shows ||= Traktr::Shows.new(self) end |
#user ⇒ Object
55 56 57 |
# File 'lib/traktr/client.rb', line 55 def user @user ||= Traktr::User.new(self) end |
#version ⇒ Object
59 60 61 |
# File 'lib/traktr/client.rb', line 59 def version @version ||= Traktr::Version.new(self) end |