module Wallhaven

Constants

VERSION

Attributes

apikey[RW]

Public Class Methods

settings() click to toggle source
# File lib/wallhaven/wallhaven.rb, line 23
def self.settings
  parse get("/settings", query)
end
tag(id) click to toggle source
# File lib/wallhaven/wallhaven.rb, line 19
def self.tag(id)
  parse get("/tag/#{id}", query)
end
wallpaper(id) click to toggle source
# File lib/wallhaven/wallhaven.rb, line 11
def self.wallpaper(id)
  parse get("/w/#{id}", query)
end

Private Class Methods

parse(response) click to toggle source
# File lib/wallhaven/wallhaven.rb, line 29
def self.parse(response)
  response.parsed_response["data"]
end
query(params = {}) click to toggle source
# File lib/wallhaven/wallhaven.rb, line 33
def self.query(params = {})
  { query: { apikey: apikey }.merge(params) }
end