class Nokaya::Deviantart

Public Class Methods

new(args, options = {}) click to toggle source
Calls superclass method Nokaya::Basic::new
# File lib/nokaya/deviantart.rb, line 6
def initialize args, options = {}
  super(args, options)
  @type = :deviantart
  parsed = parse(args[0])
  @urls = album(parsed).compact
  @author = author_name()
  @path = "#{@path}/deviantart-#{@author}-#{@workers.timed}"
  @filenames = name_files()
end

Private Instance Methods

album(page) click to toggle source
# File lib/nokaya/deviantart.rb, line 22
def album page
  return [] if page.nil?
  refs = page.css('a.thumb')
  refs.map {|li| li['data-super-img']}
end
author_name() click to toggle source
# File lib/nokaya/deviantart.rb, line 18
def author_name
  @workers.sanitize(@args[0].split('.com/')[1].chomp('/'))
end