Module: Toppr::Client::Wallpaper

Included in:
Toppr::Client
Defined in:
lib/toppr/client/wallpaper.rb

Instance Method Summary collapse

Instance Method Details

#random(username = nil, options = {}) ⇒ Hashie::Mash

Returns A wallpaper.

Examples:

Retrieve a random wallpaper for user

Toppr.random('willrax')

Returns:

  • (Hashie::Mash)

    A wallpaper



11
12
13
14
15
16
17
# File 'lib/toppr/client/wallpaper.rb', line 11

def random(username=nil, options = {})
	if username == nil 
		request(:get, "/wallpapers/random", options)
	else
		request(:get, "/users/#{username}/wallpapers/random", options)
	end
end

#wallpapers(username = nil, options = {}) ⇒ Hashie::Mash

Returns All Wallpapers.

Examples:

Retrieve wallpapers for user

Toppr.wallpapers('willrax')

Returns:

  • (Hashie::Mash)

    All Wallpapers



26
27
28
29
30
31
32
# File 'lib/toppr/client/wallpaper.rb', line 26

def wallpapers(username=nil, options = {})
  if username == nil
  	request(:get, "/wallpapers", options)
  else
  	request(:get, "/users/#{username}/wallpapers", options)
  end
end