Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
j_platform / lib / j_platform / default.rb
Size: Mime:
require 'j_platform/configurable'
require 'j_platform/version'

module JPlatform
  module Default
    ENDPOINT = (ENV['J_PLATFORM_ENDPOINT'] || 'http://login.dev1.jugnoocorp.com') unless defined? JPlatform::Default::ENDPOINT
    ANALYTICS_ENDPOINT = (ENV['PLATFORM_ANALYTICS_ENDPOINT'] || 'http://api.dev1.jugnoocorp.com') unless defined? JPlatform::Default::ANALYTICS_ENDPOINT
    CONNECTION_OPTIONS = {
      headers: {
        accept: 'application/json',
        user_agent: "JPlatform Ruby Gem #{JPlatform::VERSION}",
      },
      request: {
        open_timeout: 5,
        timeout: 10,
      },
      ssl: {
        verify: false
      },
    } unless defined? JPlatform::Default::CONNECTION_OPTIONS

    class << self

      # @return [Hash]
      def options
        Hash[JPlatform::Configurable.keys.map{|key| [key, send(key)]}]
      end

      # @return [String]
      def client_id
        ENV['J_PLATFORM_CLIENT_ID']
      end

      # @return [String]
      def client_secret
        ENV['J_PLATFORM_CLIENT_SECRET']
      end

      def endpoint
        ENDPOINT
      end

      def analytics_endpoint
        ANALYTICS_ENDPOINT
      end

      def connection_options
        CONNECTION_OPTIONS
      end
    end
  end
end