Module: Reuters::Namespaces::Search

Includes:
Base
Defined in:
lib/reuters/namespaces/search.rb,
lib/reuters/namespaces/search/all.rb,
lib/reuters/namespaces/search/equity.rb

Overview

Represents the base search namespaces. Note that because search is quite a broad namespace inside the Reuters api, it is better to use a more specific namespace such as Equity.

Defined Under Namespace

Modules: All, Equity

Class Method Summary collapse

Methods included from Base

included

Methods included from Base::ClassMethods

#configure, #endpoint

Class Method Details

.define(*strs) ⇒ String

Define a custom name or endpoint that Reuters uses to define XML Namespaces inside the request body.

Examples:

Defining a custom namespace

str = Reuters::Namespaces::Search.define(:equity_quote, :query_spec, 1)
puts str #=> "http://.../Search/EquityQuote_QuerySpec_1"

Parameters:

  • strs (String)

    to convert into a valid namespace

Returns:

  • (String)

    A full namespaced endpoint with a underscore separated camelized definition.



42
43
44
45
# File 'lib/reuters/namespaces/search.rb', line 42

def self.define(*strs)
  str = strs.map { |s| s.to_s.camelize }.join('_')
  "#{endpoint}/#{str}"
end