Module: DeviantArt::Client::Deviation

Included in:
DeviantArt::Client
Defined in:
lib/deviantart/client/deviation.rb

Instance Method Summary collapse

Instance Method Details

#download_deviation(deviationid) ⇒ Object

Get the original file download (if allowed)



29
30
31
# File 'lib/deviantart/client/deviation.rb', line 29

def download_deviation(deviationid)
  perform(DeviantArt::Deviation::Download, :get, "/api/v1/oauth2/deviation/download/#{deviationid}")
end

#get_deviation(deviationid) ⇒ Object

Fetch a deviation details



10
11
12
# File 'lib/deviantart/client/deviation.rb', line 10

def get_deviation(deviationid)
  perform(DeviantArt::Deviation, :get, "/api/v1/oauth2/deviation/#{deviationid}")
end

#get_deviation_content(deviationid) ⇒ Object

Fetch full data that is not included in the main devaition details



15
16
17
# File 'lib/deviantart/client/deviation.rb', line 15

def get_deviation_content(deviationid)
  perform(DeviantArt::Deviation::Content, :get, '/api/v1/oauth2/deviation/content', { deviationid: deviationid })
end

#get_deviation_whofaved(deviationid, offset: 0, limit: 10) ⇒ Object

Fetch a list of users who faved the deviation



20
21
22
23
24
25
26
# File 'lib/deviantart/client/deviation.rb', line 20

def get_deviation_whofaved(deviationid, offset: 0, limit: 10)
  params = {}
  params['deviationid'] = deviationid
  params['offset'] = offset if offset != 0
  params['limit'] = limit if limit != 10
  perform(DeviantArt::Deviation::WhoFaved, :get, '/api/v1/oauth2/deviation/whofaved', params)
end