Module: Tango

Defined in:
lib/tango.rb,
lib/tango/error.rb,
lib/tango/client.rb,
lib/tango/default.rb,
lib/tango/version.rb,
lib/tango/response/parse_json.rb,
lib/tango/request/json_encoded.rb,
lib/tango/response/raise_error.rb

Defined Under Namespace

Modules: Default, Request, Response Classes: Client, Error

Constant Summary collapse

VERSION =
"1.0.2"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.clientTango::Client

Delegates to a client. The client is re-initialized after any configuration option is changed.

Returns:



12
13
14
15
16
17
18
# File 'lib/tango.rb', line 12

def client
  unless defined?(@client) && @client.options.hash == options.hash
    @client = ::Tango::Client.new(options)
  end

  @client
end

.optionsHash

Global options. New created Client instances observe options here.

The #client instance is re-initialized after options are changed.

Returns:

  • (Hash)


25
26
27
# File 'lib/tango.rb', line 25

def options
  @options ||= ::Tango::Default.template.dup
end

Instance Method Details

#respond_to?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/tango.rb', line 34

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

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/tango.rb', line 30

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