module SolveBio

Annotations are genomic samples that have been annotated.

See https://www.solvebio.com/docs/api/?ruby#annotations

Constants

VERSION

Attributes

access_token[RW]
api_host[RW]
api_key[RW]
logger[RW]

Public Class Methods

login(opts={}) click to toggle source
# File lib/solvebio.rb, line 55
def self.login(opts={})
    # Clear any existing auth keys
    @access_token = nil
    @api_key = nil

    # Helper method to load credentials from local file in Ruby scripts.
    if opts[:access_token]
        @access_token = opts[:access_token]
    elsif opts[:api_key]
        @api_key = opts[:api_key]
    else
        # creds
        require 'solvebio/cli/credentials'
        _, @api_key = SolveBio::CLI::Credentials.get_credentials
    end

    if @api_key.nil? and @access_token.nil?
        puts "No credentials found. Requests to SolveBio may fail. Use 'solvebio.rb login' to save your API key."
        return false
    end

    return true
end