Module: OpenAmplify

Extended by:
Configuration
Defined in:
lib/openamplify/configuration.rb,
lib/openamplify.rb,
lib/openamplify/error.rb,
lib/openamplify/client.rb,
lib/openamplify/request.rb,
lib/openamplify/version.rb,
lib/openamplify/connection.rb,
lib/openamplify/analysis/context.rb,
lib/openamplify/response/raise_client_error.rb,
lib/openamplify/response/raise_server_error.rb

Overview

TODO: output_format, analysis, scoring can be specied in the client and becomes the default unless overriden

Defined Under Namespace

Modules: Analysis, Configuration, Connection, Request, Response Classes: Client, Error

Constant Summary collapse

VERSION =
"0.3.0"

Constants included from Configuration

Configuration::DEFAULT_ANALYSIS, Configuration::DEFAULT_API_KEY, Configuration::DEFAULT_ENDPOINT, Configuration::DEFAULT_HTTP_ADAPTER, Configuration::DEFAULT_HTTP_METHOD, Configuration::DEFAULT_INPUT_TEXT, Configuration::DEFAULT_OUTPUT_FORMAT, Configuration::DEFAULT_SCORING, Configuration::DEFAULT_SOURCE_URL, Configuration::DEFAULT_USER_AGENT, Configuration::VALID_CONFIG_KEYS, Configuration::VALID_CONNECTION_KEYS, Configuration::VALID_OPTIONS_KEYS

Instance Method Summary collapse

Methods included from Configuration

configure, extended, options, reset

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object

Delegate to OpenAmplify::Client



13
14
15
16
# File 'lib/openamplify.rb', line 13

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

Instance Method Details

#new(options = {}) ⇒ Object



7
8
9
# File 'lib/openamplify.rb', line 7

def new(options={})
  Client.new(options)
end

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

Returns:

  • (Boolean)


18
19
20
# File 'lib/openamplify.rb', line 18

def respond_to?(method, include_private = false)
  new.respond_to?(method, include_private) || super(method, include_private)
end