Your public API can be specified in the +options+ hash or preferably
 using the Configuration.
501896
def recaptcha_tags(options = {})
      if options.key?(:stoken)
        raise(RecaptchaError, "Secure Token is deprecated. Please remove 'stoken' from your calls to recaptcha_tags.")
      end
      if options.key?(:ssl)
        raise(RecaptchaError, "SSL is now always true. Please remove 'ssl' from your calls to recaptcha_tags.")
      end

      noscript = options.delete(:noscript)

      html, tag_attributes, fallback_uri = Recaptcha::ClientHelper.recaptcha_components(options)
      html << %(<div #{tag_attributes}></div>\n)

      if noscript != false
        html << <<-HTML
          <noscript>
            <div>
              <div style="width: 302px; height: 422px; position: relative;">
                <div style="width: 302px; height: 422px; position: absolute;">
                  <iframe
                    src="#{fallback_uri}"
                    name="ReCAPTCHA"
                    style="width: 302px; height: 422px; border-style: none; border: 0; overflow: hidden;">
                  </iframe>
                </div>
              </div>
              <div style="width: 300px; height: 60px; border-style: none;
                bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px;
                background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;">
                <textarea id="g-recaptcha-response" name="g-recaptcha-response"
                  class="g-recaptcha-response"
                  style="width: 250px; height: 40px; border: 1px solid #c1c1c1;
                  margin: 10px 25px; padding: 0px; resize: none;">
                </textarea>
              </div>
            </div>
          </noscript>
        HTML
      end

      html.respond_to?(:html_safe) ? html.html_safe : html
    end
882515
def set_options(opts = {})
      @wsdl           = opts[:wsdl]           || Settings.session.wsdl
      @endpoint       = opts[:endpoint]       || Settings.session.endpoint
      @soap_log       = opts[:soap_log]       || Settings.session.soap_log
      @soap_logger    = opts[:soap_logger]    || Settings.session.soap_logger
      @soap_log_level = opts[:soap_log_level] || Settings.session.soap_log_level
      @username       = opts[:username]       || Settings.session.username
      @password       = opts[:password]       || Settings.session.password
      @auth_cookie    = opts[:auth_cookie]    || nil
    end
1034375
def options(path, options = {}, &block)
      perform_request Net::HTTP::Options, path, options, &block
    end
211429
def set(options)
      json_body = options.to_json
      request_uri = "#{base_request_uri}/state"
      HTTParty.put(request_uri, :body => json_body)
    end
1273831
def instance_method_hash(options)
      ChainOptions::Util.slice(options, Option::METHOD_SYMBOLS).each_with_object({}) do |(meth, value), h|
        next h[meth] = value if value.respond_to?(:call)

        h[meth] = instance.public_method(value)
      end
    end
99462
def options(self, *args, **kwargs):
        '''
        
        '''
        # Allow X-Auth-Token in requests
        request_headers = self.request.headers.get('Access-Control-Request-Headers')
        allowed_headers = request_headers.split(',')

        # Filter allowed header here if needed.

        # Allow request headers
        self.set_header('Access-Control-Allow-Headers', ','.join(allowed_headers))

        # Allow X-Auth-Token in responses
        self.set_header('Access-Control-Expose-Headers', 'X-Auth-Token')

        # Allow all methods
        self.set_header('Access-Control-Allow-Methods', 'OPTIONS, GET, POST')

        self.set_status(204)
        self.finish()
1297997
def create_api_option_vip(self):
        """"""
        return ApiOptionVip(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
92292
function createApiError(options) {
  return {
    name: options.name || 'ApiError',
    message: options.message,
    status: options.status || 500,
    details: options.details,
    code: options.code || options.status || 500,

    toString: function() {
      return this.name + ' [' + this.status + '] - ' + this.message;
    }
  };
}
592163
function(options){
  
  // Set the default options
  this.appKey = '';
  this.environment = 'integration';
  this.redirectUri = '';
  this.tokenCookie = 'FS_AUTH_TOKEN';
  this.maxThrottledRetries = 10;
  this.saveAccessToken = false;
  this.accessToken = '';
  this.jwt = '';
  this.middleware = {
    request: [
      requestMiddleware.url,
      requestMiddleware.defaultAcceptHeader,
      requestMiddleware.authorizationHeader, 
      requestMiddleware.disableAutomaticRedirects, 
      requestMiddleware.body
    ],
    response: [
      responseMiddleware.redirect, 
      responseMiddleware.throttling, 
      responseMiddleware.json
    ]
  };
  
  // Process options
  this.config(options);
}
647667
function (options) {

            if (typeof options === 'object') {

                // Add implementation-specific method prefix (dashboard or app)
                options.name = this.prefix + '.' + options.name;
                return this.transport.send(options);
            }  else {
                throw new Error('Transport options must be an object.');
            }
        }
281668
def build_request(options = {})

				src_creds_name = SRC_CREDS

				options = options.dup #Don't clobber the original hash
				#NOTE: Could extend this to read WSDL document or using Savon client to tell which nodes are allowed in the request
				#performing the same type of test against passed in variables on each and replacing with the appropriate value

				final_opts = options.dup

				options.keys.each do |key|
					orig_key = key
					new_key = orig_key.to_s.gsub("_", "").downcase
					if (new_key == src_creds_name.downcase)
						final_opts[src_creds_name] = final_opts[key] #Set "SourceCredentials" to hash referenced by similarly named
						final_opts.delete(orig_key)
					end
				end
				
				opts = {};
				final_opts.each  do |key, value|
					new_val = value
					if value.kind_of?(Array)
						tranformed = {}	
						if item[0].kind_of? Integer
							transformed[:int] = value
						elsif item[0].kind_of? String
							transformed[:string] = value
						else
							break #Don't know how to deal with it, return regular
						end
						 new_val = transformed
					end
					opts[key] = new_val
				end
		
				request_body = 
				{
					"PageSize" => 10, 
					"CurrentPageIndex" => 0
				}

				request_body["XMLDetail"] = "Bare" unless opts["Fields"]


				request_body[src_creds_name] = @src_creds.to_hash if @src_creds
				request_body["UserCredentials"] = @usr_creds.to_hash if @usr_creds	

				return request_body.merge!(opts)
		end
1305476
function HTTPOptions(options) {
  if (!(this instanceof HTTPOptions))
    return new HTTPOptions(options);

  this.network = Network.primary;
  this.logger = null;
  this.node = null;
  this.apiKey = base58.encode(random.randomBytes(20));
  this.apiHash = digest.hash256(Buffer.from(this.apiKey, 'ascii'));
  this.noAuth = false;

  this.prefix = null;
  this.host = '127.0.0.1';
  this.port = 8080;
  this.ssl = false;
  this.keyFile = null;
  this.certFile = null;

  this.fromOptions(options);
}
1180941
function config(options) {
    var current = config.current
    Object.assign(current, options)
    api._init(current)
}
278336
def to_hash
      OPTIONS.inject({}) do |hash, option|
        hash.merge(option.to_sym => send(option))
      end
    end
702137
function RequestOptions(options) {
  if (!(this instanceof RequestOptions))
    return new RequestOptions(options);

  this.uri = 'http://localhost:80/';
  this.host = 'localhost';
  this.path = '/';
  this.port = 80;
  this.ssl = false;
  this.method = 'GET';
  this.strictSSL = true;
  this.pool = false;
  this.agent = USER_AGENT;

  this.type = null;
  this.expect = null;
  this.query = null;
  this.body = null;
  this.auth = null;
  this.limit = 10 << 20;
  this.maxRedirects = 5;
  this.timeout = 5000;
  this.buffer = false;
  this.headers = null;

  // Hack
  ensureRequires();

  if (options)
    this.fromOptions(options);
}
905245
def build(option_hash)
      opts = option_hash.dup || {}
      @relation = @base.scoped
      opts.stringify_keys!
      opts = collapse_multiparameter_options(opts)
      assign_attributes(opts)
      self
    end
1170588
def api_config(path):
    '''
    
    '''
    # Let's grab a copy of salt-api's required defaults
    opts = DEFAULT_API_OPTS.copy()

    # Let's override them with salt's master opts
    opts.update(client_config(path, defaults=DEFAULT_MASTER_OPTS.copy()))

    # Let's set the pidfile and log_file values in opts to api settings
    opts.update({
        'pidfile': opts.get('api_pidfile', DEFAULT_API_OPTS['api_pidfile']),
        'log_file': opts.get('api_logfile', DEFAULT_API_OPTS['api_logfile']),
    })

    prepend_root_dir(opts, [
        'api_pidfile',
        'api_logfile',
        'log_file',
        'pidfile'
    ])
    return opts