Sha256: 734c0aaa63b49169d67659755181f2ed6a5226ad989075050a8d9c04cf739099

Contents?: true

Size: 628 Bytes

Versions: 4

Compression:

Stored size: 628 Bytes

Contents

# frozen_string_literal: true

require 'ivapi/client'
require 'ivapi/default'

module Ivapi
  extend Ivapi::Configuration

  class << self
    def client
      unless defined?(@client) && @client.same_options?(options)
        @client = Ivapi::Client.new(options)
      end

      @client
    end

    private

    def method_missing(method_name, *args, &block)
      return super unless client.respond_to?(method_name)

      client.send(method_name, *args, &block)
    end

    def respond_to_missing?(method_name, include_private = false)
      client.respond_to?(method_name, include_private)
    end
  end
end

Ivapi.setup

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ivapi-1.8.0 lib/ivapi.rb
ivapi-1.7.0 lib/ivapi.rb
ivapi-1.6.1 lib/ivapi.rb
ivapi-1.6.0 lib/ivapi.rb