class Ygoprodeck::Fname

Attributes

f_name[R]

Public Class Methods

is(f_name) click to toggle source
# File lib/ygoprodeck/search/fuzzy_name.rb, line 5
def self.is(f_name)
        url = "#{Ygoprodeck::Endpoint.is}?fname=#{f_name}"
        uri = URI(url)
        response = Net::HTTP.get(uri)
        load = JSON.parse(response)
        
        if load[0] == nil
                '{"error"=>"No card matching your query was found in the database."}'
        else
                load[0]
        end
        
end