Sha256: 462da959da65ac2274522eaa4f3ff8c7d47fe27e2cb7a4642637bb2f35d1b2ff

Contents?: true

Size: 694 Bytes

Versions: 3

Compression:

Stored size: 694 Bytes

Contents

# encoding:utf-8

require 'mysql2'

module Javlibrary
    def actor_hash
        client = Javlibrary.client
        actor_hash = Hash.new
        client.query("SELECT * FROM actor").each do |item|
            actor_hash["#{item['actor_name']}"] = item['actor_id']
        end
        client.close

        actor_hash
    end

    def genre_hash
        client = Javlibrary.client
        category_hash = Hash.new
        client.query("SELECT * FROM category").each do |item|
            category_hash["#{item['category_name']}"] = item['category_id']
        end
        client.close

        category_hash
    end

    module_function :actor_hash, :genre_hash
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
javlibrary-0.1.8 lib/javlibrary/info_hash.rb
javlibrary-0.1.7 lib/javlibrary/info_hash.rb
javlibrary-0.1.6 lib/javlibrary/info_hash.rb