Sha256: dc4fa2822755ea0cb85ef1ad983f8b16122a8d185eb396793f54deff514b8288

Contents?: true

Size: 915 Bytes

Versions: 1

Compression:

Stored size: 915 Bytes

Contents

module Kooaba
  QUERY_URL  = "https://query-api.kooaba.com/v4/"
  UPLOAD_URL = "https://upload-api.kooaba.com/api/v4/"

  def self.data_key=(data_key)
    @@data_key = data_key
  end

  def self.query_key=(query_key)
    @@query_key = query_key
  end

  def self.data_key
    @@data_key
  end

  def self.query_key
    @@query_key
  end

  def self.upload(item, bucket_id)
    raise ArgumentError, "You need to specify the Data Key before uploading an item" if !Kooaba.data_key
    UploadRequest.new(item, bucket_id).start
  end

  def self.query(image_path)
    raise ArgumentError, "You need to specify the Query Key before making queries" if !Kooaba.query_key
    QueryRequest.new(image_path).start
  end

  def self.update(item_uuid, params = {})
    raise ArgumentError, "You need to specify the item uuid for the item you want to update" if !item_uuid
    UpdateRequest.new(item_uuid, params).start
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kooaba-0.0.7 lib/kooaba/base.rb