Sha256: 7cc10e82e6645c3027d2ced9ef5b14d93c8a0815ab3dd22a3a8a8938f0c0bac0

Contents?: true

Size: 641 Bytes

Versions: 1

Compression:

Stored size: 641 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.2 lib/nokaya/favd.rb