Sha256: 1e43551a81a184d28f2b7322f40c1a1e04775f9c3a03683eaf7949958ed37e11

Contents?: true

Size: 930 Bytes

Versions: 7

Compression:

Stored size: 930 Bytes

Contents

require 'voog_api/version'
require 'voog_api/client'

module Voog

  class << self
    
    attr_accessor :host, :api_token, :auto_paginate, :per_page

    def client(options = {})
      unless host.nil? && api_token.nil?
        Voog::Client.new(host, api_token, options)
      else
        nil
      end
    end

    def configure
      yield self
      true
    end

    if RUBY_VERSION >= '1.9'
      
      def respond_to_missing?(method_name, include_private = false)
        client.respond_to?(method_name, include_private)
      end
      
    end

    if RUBY_VERSION < '1.9'
      
      def respond_to?(method_name, include_private = false)
        client.respond_to?(method_name, include_private) || super
      end
      
    end

    private

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
voog_api-0.0.16 lib/voog_api.rb
voog_api-0.0.15 lib/voog_api.rb
voog_api-0.0.14 lib/voog_api.rb
voog_api-0.0.13 lib/voog_api.rb
voog_api-0.0.12 lib/voog_api.rb
voog_api-0.0.11 lib/voog_api.rb
voog_api-0.0.10 lib/voog_api.rb