Sha256: 0fe9c8a2787d1d61265ce98d7e49d4b76d846a913254bddc3ee6f2635e127f0f

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

# encoding: utf-8
module Nokaya
  class Favd < Basic

    attr_reader :author

    def initialize args, options
      super(args, options)
      @type = :favd
      parsed = self.parse(args[0])
      @image_url = [get_favd(parsed)]
      @author = author(parsed)
      @file_name = [name()]
    end

    private

    def author page
      page.css('.username')[0].text
    end

    def get_favd page
      page.css('#largeImage')[0]['src']
    end

    def name
      unless @name.nil?
        "#{@type.to_s}-#{@name}"
      else
        "#{@type.to_s}-#{@workers.sanitize(@author)}-#{@workers.timed}.jpg"
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nokaya-0.1.1 lib/nokaya/favd.rb