Module: Traktr::User::Network
- Includes:
- HTTParty
- Defined in:
- lib/traktr/user/network.rb
Class Method Summary collapse
- .followers(username = Traktr.username) ⇒ Object
- .following(username = Traktr.username) ⇒ Object
- .friends(username = Traktr.username) ⇒ Object
Class Method Details
.followers(username = Traktr.username) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/traktr/user/network.rb', line 7 def self.followers(username = Traktr.username) response = self.get('/' + File.join('followers.json', Traktr.api_key, username)) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |item| Mash.new(item) end end |
.following(username = Traktr.username) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/traktr/user/network.rb', line 16 def self.following(username = Traktr.username) response = self.get('/' + File.join('following.json', Traktr.api_key, username)) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |item| Mash.new(item) end end |
.friends(username = Traktr.username) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/traktr/user/network.rb', line 25 def self.friends(username = Traktr.username) response = self.get('/' + File.join('friends.json', Traktr.api_key, username)) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |item| Mash.new(item) end end |