Sha256: d661018a16e961dd722c23e54c0d71c628a0c97ab22ed0cd905d64ebf83848db

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

require_relative "justa/version"
require_relative "justa/authenticator"
require_relative "justa/request"
require_relative "justa/object"
require_relative "justa/model"
require_relative "justa/core_ext"
require_relative "justa/errors"
require_relative "justa/util"
require_relative "justa/token_manager"
require_relative "justa/order_commom"

Dir[File.expand_path("justa/resources/*.rb", __dir__)].map do |path|
  require path
end

module Justa
  class Error < StandardError; end

  class << self
    attr_accessor :username, :password, :client_id, :client_secret, :integrator_id, :callback_url, :credentials,
                  :default_client_key, :document
    attr_reader :api_endpoint

    def production?
      env = nil
      begin
        env = ENV["RACK_ENV"] == "production" ||
              ENV["RAILS_ENV"] == "production" ||
              ENV["PRODUCTION"] ||
              ENV["production"] || (Rails.env.production? if Object.const_defined?("::Rails"))
      rescue NameError => e
        return false
      end

      env || false
    end
  end

  @default_client_key = :default

  @api_endpoint = Justa.production? ? "https://gateway.justa.com.vc" : "https://integrador.staging.justa.com.vc"

  puts "Running on production" if production?
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
justa-ruby-0.1.9 lib/justa.rb