Sha256: 07f7d9429966c918c0b3986fdf9feabea51bee49dee7476c833917ec04913606

Contents?: true

Size: 831 Bytes

Versions: 7

Compression:

Stored size: 831 Bytes

Contents

require 'twitter/client'
require 'twitter/configurable'

module Twitter
  class << self
    include Twitter::Configurable

    # Delegate to a Twitter::Client
    #
    # @return [Twitter::Client]
    def client
      @client = Twitter::Client.new(options) unless defined?(@client) && @client.cache_key == options.hash
      @client
    end

    def respond_to_missing?(method_name, include_private=false); client.respond_to?(method_name, include_private); end if RUBY_VERSION >= "1.9"
    def respond_to?(method_name, include_private=false); client.respond_to?(method_name, include_private) || super; end if RUBY_VERSION < "1.9"

  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

Twitter.setup

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
twitter-4.4.0 lib/twitter.rb
twitter-4.3.0 lib/twitter.rb
twitter-4.2.0 lib/twitter.rb
twitter-4.1.2 lib/twitter.rb
twitter-4.1.1 lib/twitter.rb
twitter-4.1.0 lib/twitter.rb
twitter-4.0.0 lib/twitter.rb