Sha256: 9e553f0f2b734d4bc2361ba20cc27ffa44e5f595c472a401321eb707a9f71c67

Contents?: true

Size: 694 Bytes

Versions: 1

Compression:

Stored size: 694 Bytes

Contents

# encoding: utf-8
module Nokaya

  class Basic

    attr_reader :options, :args, :file_name, :type, :name, :path
    attr_accessor :image_url

    def initialize args, options
      @options = options
      @workers = Workers.new(options)
      @args = @workers.check_args(args)
      @file_name = []
      @image_url = []
      @path = @workers.path
      @type = :basic
      @name = options['name'] if options['name']
      @platform = RbConfig::CONFIG['host_os']
    end

    def get_basic page
      page.xpath("//meta[@property='og:image']/@content").first.value
    end

    def parse url
      Nokogiri::HTML(open url)
    end

    def save
      @workers.save(self)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nokaya-0.1.2 lib/nokaya/basic.rb